diff options
| author | Alexander Kornienko <alexfh@google.com> | 2017-11-23 17:02:48 +0000 |
|---|---|---|
| committer | Alexander Kornienko <alexfh@google.com> | 2017-11-23 17:02:48 +0000 |
| commit | 92154161ca5869f7777ecffafc7018c6be2be6a5 (patch) | |
| tree | 76fa457fb5d64b87b19368d355f751d812fea070 /test | |
| parent | b6d0858aa3482d67abfbcd3115d495b86c239c78 (diff) | |
[clang-tidy] rename_check.py misc-argument-comment bugprone-argument-comment
Summary: + manually convert the unit test to lit test.
Reviewers: hokein
Reviewed By: hokein
Subscribers: mgorny, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D40392
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@318926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
| -rw-r--r-- | test/clang-tidy/bugprone-argument-comment-gmock.cpp (renamed from test/clang-tidy/misc-argument-comment-gmock.cpp) | 2 | ||||
| -rw-r--r-- | test/clang-tidy/bugprone-argument-comment-strict.cpp (renamed from test/clang-tidy/misc-argument-comment-strict.cpp) | 2 | ||||
| -rw-r--r-- | test/clang-tidy/bugprone-argument-comment.cpp (renamed from test/clang-tidy/misc-argument-comment.cpp) | 46 |
3 files changed, 42 insertions, 8 deletions
diff --git a/test/clang-tidy/misc-argument-comment-gmock.cpp b/test/clang-tidy/bugprone-argument-comment-gmock.cpp index 56a7b143..e79395e7 100644 --- a/test/clang-tidy/misc-argument-comment-gmock.cpp +++ b/test/clang-tidy/bugprone-argument-comment-gmock.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s misc-argument-comment %t +// RUN: %check_clang_tidy %s bugprone-argument-comment %t namespace testing { namespace internal { diff --git a/test/clang-tidy/misc-argument-comment-strict.cpp b/test/clang-tidy/bugprone-argument-comment-strict.cpp index d37b869b..0e06a4ce 100644 --- a/test/clang-tidy/misc-argument-comment-strict.cpp +++ b/test/clang-tidy/bugprone-argument-comment-strict.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s misc-argument-comment %t -- \ +// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \ // RUN: -config="{CheckOptions: [{key: StrictMode, value: 1}]}" -- void f(int _with_underscores_); diff --git a/test/clang-tidy/misc-argument-comment.cpp b/test/clang-tidy/bugprone-argument-comment.cpp index e20ba10f..64527911 100644 --- a/test/clang-tidy/misc-argument-comment.cpp +++ b/test/clang-tidy/bugprone-argument-comment.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s misc-argument-comment %t +// RUN: %check_clang_tidy %s bugprone-argument-comment %t // FIXME: clang-tidy should provide a -verify mode to make writing these checks // easier and more accurate. @@ -14,9 +14,16 @@ void g() { f(/*y=*/0, /*z=*/0); // CHECK-FIXES: {{^}} f(/*y=*/0, /*z=*/0); + f(/*x=*/1, /*y=*/1); + ffff(0 /*aaaa=*/, /*bbbb*/ 0); // Unsupported formats. } +struct C { + C(int x, int y); +}; +C c(/*x=*/0, /*y=*/0); + struct Closure {}; template <typename T1, typename T2> @@ -45,11 +52,38 @@ void templates() { #define FALSE 0 void qqq(bool aaa); -void f() { qqq(/*bbb=*/FALSE); } -// CHECK-MESSAGES: [[@LINE-1]]:16: warning: argument name 'bbb' in comment does not match parameter name 'aaa' -// CHECK-FIXES: void f() { qqq(/*bbb=*/FALSE); } +void f2() { qqq(/*bbb=*/FALSE); } +// CHECK-MESSAGES: [[@LINE-1]]:17: warning: argument name 'bbb' in comment does not match parameter name 'aaa' +// CHECK-FIXES: void f2() { qqq(/*bbb=*/FALSE); } -void f(bool _with_underscores_); +void f3(bool _with_underscores_); void ignores_underscores() { - f(/*With_Underscores=*/false); + f3(/*With_Underscores=*/false); +} + +namespace ThisEditDistanceAboveThreshold { +void f4(int xxx); +void g() { f4(/*xyz=*/0); } +// CHECK-MESSAGES: [[@LINE-1]]:15: warning: argument name 'xyz' in comment does not match parameter name 'xxx' +// CHECK-FIXES: void g() { f4(/*xyz=*/0); } +} + +namespace OtherEditDistanceAboveThreshold { +void f5(int xxx, int yyy); +void g() { f5(/*Zxx=*/0, 0); } +// CHECK-MESSAGES: [[@LINE-1]]:15: warning: argument name 'Zxx' in comment does not match parameter name 'xxx' +// CHECK-FIXES: void g() { f5(/*xxx=*/0, 0); } +struct C2 { + C2(int xxx, int yyy); +}; +C2 c2(/*Zxx=*/0, 0); +// CHECK-MESSAGES: [[@LINE-1]]:7: warning: argument name 'Zxx' in comment does not match parameter name 'xxx' +// CHECK-FIXES: C2 c2(/*xxx=*/0, 0); +} + +namespace OtherEditDistanceBelowThreshold { +void f6(int xxx, int yyy); +void g() { f6(/*xxy=*/0, 0); } +// CHECK-MESSAGES: [[@LINE-1]]:15: warning: argument name 'xxy' in comment does not match parameter name 'xxx' +// CHECK-FIXES: void g() { f6(/*xxy=*/0, 0); } } |
