summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Toth <jonas.toth@gmail.com>2018-10-04 16:39:41 +0000
committerJonas Toth <jonas.toth@gmail.com>2018-10-04 16:39:41 +0000
commitba765894c5dece916e4381c5507d71a3db5f47a8 (patch)
tree791f230c6998ba8d1e416f91c406ed0bfc285acd
parent3e5fcd6c3f1df562e41cf3e82cab234691633629 (diff)
[clang-tidy] fix failing unit tests
The removal from the FIX-IT notes through the check-clang-tidy script was done incorrect. I did not detect beforehand but adjusted the script and tests accordingly
-rw-r--r--clang-tools-extra/test/clang-tidy/bugprone-argument-comment-gmock.cpp43
-rw-r--r--clang-tools-extra/test/clang-tidy/bugprone-argument-comment-strict.cpp12
-rw-r--r--clang-tools-extra/test/clang-tidy/bugprone-argument-comment.cpp9
-rwxr-xr-xclang-tools-extra/test/clang-tidy/check_clang_tidy.py2
-rw-r--r--clang-tools-extra/test/clang-tidy/fuchsia-default-arguments.cpp6
5 files changed, 30 insertions, 42 deletions
diff --git a/clang-tools-extra/test/clang-tidy/bugprone-argument-comment-gmock.cpp b/clang-tools-extra/test/clang-tidy/bugprone-argument-comment-gmock.cpp
index 8b67a915b52..95b1a071301 100644
--- a/clang-tools-extra/test/clang-tidy/bugprone-argument-comment-gmock.cpp
+++ b/clang-tools-extra/test/clang-tidy/bugprone-argument-comment-gmock.cpp
@@ -84,20 +84,18 @@ void test_gmock_expectations() {
MockDerived m;
EXPECT_CALL(m, Method(/*param_one=*/1, /*param_tw=*/2));
// CHECK-NOTES: [[@LINE-1]]:42: warning: argument name 'param_tw' in comment does not match parameter name 'param_two'
-// CHECK-NOTES: [[@LINE-2]]:42: note: FIX-IT applied suggested code changes
-// CHECK-NOTES: [[@LINE-19]]:42: note: 'param_two' declared here
-// CHECK-NOTES: [[@LINE-15]]:3: note: actual callee ('gmock_Method') is declared here
-// CHECK-NOTES: [[@LINE-33]]:30: note: expanded from macro 'MOCK_METHOD2'
-// CHECK-NOTES: [[@LINE-36]]:7: note: expanded from macro 'GMOCK_METHOD2_'
+// CHECK-NOTES: [[@LINE-18]]:42: note: 'param_two' declared here
+// CHECK-NOTES: [[@LINE-14]]:3: note: actual callee ('gmock_Method') is declared here
+// CHECK-NOTES: [[@LINE-32]]:30: note: expanded from macro 'MOCK_METHOD2'
+// CHECK-NOTES: [[@LINE-35]]:7: note: expanded from macro 'GMOCK_METHOD2_'
// CHECK-NOTES: note: expanded from here
// CHECK-FIXES: EXPECT_CALL(m, Method(/*param_one=*/1, /*param_two=*/2));
EXPECT_CALL(m, Method2(/*p_on=*/3, /*p_two=*/4));
// CHECK-NOTES: [[@LINE-1]]:26: warning: argument name 'p_on' in comment does not match parameter name 'p_one'
-// CHECK-NOTES: [[@LINE-2]]:26: note: FIX-IT applied suggested code changes
-// CHECK-NOTES: [[@LINE-27]]:28: note: 'p_one' declared here
-// CHECK-NOTES: [[@LINE-23]]:3: note: actual callee ('gmock_Method2') is declared here
-// CHECK-NOTES: [[@LINE-41]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
-// CHECK-NOTES: [[@LINE-45]]:7: note: expanded from macro 'GMOCK_METHOD2_'
+// CHECK-NOTES: [[@LINE-25]]:28: note: 'p_one' declared here
+// CHECK-NOTES: [[@LINE-21]]:3: note: actual callee ('gmock_Method2') is declared here
+// CHECK-NOTES: [[@LINE-39]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
+// CHECK-NOTES: [[@LINE-43]]:7: note: expanded from macro 'GMOCK_METHOD2_'
// CHECK-NOTES: note: expanded from here
// CHECK-FIXES: EXPECT_CALL(m, Method2(/*p_one=*/3, /*p_two=*/4));
@@ -105,18 +103,16 @@ void test_gmock_expectations() {
#define PARAM2 22
EXPECT_CALL(m, Method2(/*p_on1=*/PARAM1, /*p_tw2=*/PARAM2));
// CHECK-NOTES: [[@LINE-1]]:26: warning: argument name 'p_on1' in comment does not match parameter name 'p_one'
-// CHECK-NOTES: [[@LINE-2]]:26: note: FIX-IT applied suggested code changes
-// CHECK-NOTES: [[@LINE-39]]:28: note: 'p_one' declared here
-// CHECK-NOTES: [[@LINE-35]]:3: note: actual callee ('gmock_Method2') is declared here
-// CHECK-NOTES: [[@LINE-53]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
-// CHECK-NOTES: [[@LINE-57]]:7: note: expanded from macro 'GMOCK_METHOD2_'
+// CHECK-NOTES: [[@LINE-36]]:28: note: 'p_one' declared here
+// CHECK-NOTES: [[@LINE-32]]:3: note: actual callee ('gmock_Method2') is declared here
+// CHECK-NOTES: [[@LINE-50]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
+// CHECK-NOTES: [[@LINE-54]]:7: note: expanded from macro 'GMOCK_METHOD2_'
// CHECK-NOTES: note: expanded from here
-// CHECK-NOTES: [[@LINE-8]]:44: warning: argument name 'p_tw2' in comment does not match parameter name 'p_two'
-// CHECK-NOTES: [[@LINE-9]]:44: note: FIX-IT applied suggested code changes
-// CHECK-NOTES: [[@LINE-46]]:39: note: 'p_two' declared here
-// CHECK-NOTES: [[@LINE-42]]:3: note: actual callee ('gmock_Method2') is declared here
-// CHECK-NOTES: [[@LINE-60]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
-// CHECK-NOTES: [[@LINE-64]]:7: note: expanded from macro 'GMOCK_METHOD2_'
+// CHECK-NOTES: [[@LINE-7]]:44: warning: argument name 'p_tw2' in comment does not match parameter name 'p_two'
+// CHECK-NOTES: [[@LINE-42]]:39: note: 'p_two' declared here
+// CHECK-NOTES: [[@LINE-38]]:3: note: actual callee ('gmock_Method2') is declared here
+// CHECK-NOTES: [[@LINE-56]]:36: note: expanded from macro 'MOCK_CONST_METHOD2'
+// CHECK-NOTES: [[@LINE-60]]:7: note: expanded from macro 'GMOCK_METHOD2_'
// CHECK-NOTES: note: expanded from here
// CHECK-FIXES: EXPECT_CALL(m, Method2(/*p_one=*/PARAM1, /*p_two=*/PARAM2));
@@ -128,8 +124,7 @@ void test_gmock_direct_calls() {
MockDerived m;
m.Method(/*param_one=*/1, /*param_tw=*/2);
// CHECK-NOTES: [[@LINE-1]]:29: warning: argument name 'param_tw' in comment does not match parameter name 'param_two'
-// CHECK-NOTES: [[@LINE-2]]:29: note: FIX-IT applied suggested code changes
-// CHECK-NOTES: [[@LINE-63]]:42: note: 'param_two' declared here
-// CHECK-NOTES: [[@LINE-59]]:16: note: actual callee ('Method') is declared here
+// CHECK-NOTES: [[@LINE-58]]:42: note: 'param_two' declared here
+// CHECK-NOTES: [[@LINE-54]]:16: note: actual callee ('Method') is declared here
// CHECK-FIXES: m.Method(/*param_one=*/1, /*param_two=*/2);
}
diff --git a/clang-tools-extra/test/clang-tidy/bugprone-argument-comment-strict.cpp b/clang-tools-extra/test/clang-tidy/bugprone-argument-comment-strict.cpp
index 68f8da3649b..46e346fa6cb 100644
--- a/clang-tools-extra/test/clang-tidy/bugprone-argument-comment-strict.cpp
+++ b/clang-tools-extra/test/clang-tidy/bugprone-argument-comment-strict.cpp
@@ -6,23 +6,19 @@ void g(int x_);
void ignores_underscores() {
f(/*With_Underscores=*/0);
// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'With_Underscores' in comment does not match parameter name '_with_underscores_'
-// CHECK-NOTES: [[@LINE-2]]:5: note: FIX-IT applied suggested code changes
-// CHECK-NOTES: [[@LINE-6]]:12: note: '_with_underscores_' declared here
+// CHECK-NOTES: [[@LINE-5]]:12: note: '_with_underscores_' declared here
// CHECK-FIXES: f(/*_with_underscores_=*/0);
f(/*with_underscores=*/1);
// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'with_underscores' in comment does not match parameter name '_with_underscores_'
-// CHECK-NOTES: [[@LINE-2]]:5: note: FIX-IT applied suggested code changes
-// CHECK-NOTES: [[@LINE-12]]:12: note: '_with_underscores_' declared here
+// CHECK-NOTES: [[@LINE-10]]:12: note: '_with_underscores_' declared here
// CHECK-FIXES: f(/*_with_underscores_=*/1);
f(/*_With_Underscores_=*/2);
// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name '_With_Underscores_' in comment does not match parameter name '_with_underscores_'
-// CHECK-NOTES: [[@LINE-2]]:5: note: FIX-IT applied suggested code changes
-// CHECK-NOTES: [[@LINE-17]]:12: note: '_with_underscores_' declared here
+// CHECK-NOTES: [[@LINE-14]]:12: note: '_with_underscores_' declared here
// CHECK-FIXES: f(/*_with_underscores_=*/2);
g(/*X=*/3);
// CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'X' in comment does not match parameter name 'x_'
-// CHECK-NOTES: [[@LINE-2]]:5: note: FIX-IT applied suggested code changes
-// CHECK-NOTES: [[@LINE-21]]:12: note: 'x_' declared here
+// CHECK-NOTES: [[@LINE-17]]:12: note: 'x_' declared here
// CHECK-FIXES: g(/*x_=*/3);
}
diff --git a/clang-tools-extra/test/clang-tidy/bugprone-argument-comment.cpp b/clang-tools-extra/test/clang-tidy/bugprone-argument-comment.cpp
index 53b9726f58c..08f87170c42 100644
--- a/clang-tools-extra/test/clang-tidy/bugprone-argument-comment.cpp
+++ b/clang-tools-extra/test/clang-tidy/bugprone-argument-comment.cpp
@@ -47,8 +47,7 @@ void templates() {
variadic(/*xxx=*/0, /*yyy=*/1);
variadic2(/*zzU=*/0, /*xxx=*/1, /*yyy=*/2);
// CHECK-NOTES: [[@LINE-1]]:13: warning: argument name 'zzU' in comment does not match parameter name 'zzz'
- // CHECK-NOTES: [[@LINE-2]]:13: note: FIX-IT applied suggested code changes
- // CHECK-NOTES: :[[@LINE-7]]:20: note: 'zzz' declared here
+ // CHECK-NOTES: :[[@LINE-6]]:20: note: 'zzz' declared here
// CHECK-FIXES: variadic2(/*zzz=*/0, /*xxx=*/1, /*yyy=*/2);
}
@@ -76,16 +75,14 @@ namespace OtherEditDistanceAboveThreshold {
void f5(int xxx, int yyy);
void g() { f5(/*Zxx=*/0, 0); }
// CHECK-NOTES: [[@LINE-1]]:15: warning: argument name 'Zxx' in comment does not match parameter name 'xxx'
-// CHECK-NOTES: [[@LINE-2]]:15: note: FIX-IT applied suggested code changes
-// CHECK-NOTES: [[@LINE-4]]:13: note: 'xxx' declared here
+// CHECK-NOTES: [[@LINE-3]]:13: note: 'xxx' declared here
// CHECK-FIXES: void g() { f5(/*xxx=*/0, 0); }
struct C2 {
C2(int xxx, int yyy);
};
C2 c2(/*Zxx=*/0, 0);
// CHECK-NOTES: [[@LINE-1]]:7: warning: argument name 'Zxx' in comment does not match parameter name 'xxx'
-// CHECK-NOTES: [[@LINE-2]]:7: note: FIX-IT applied suggested code changes
-// CHECK-NOTES: [[@LINE-5]]:10: note: 'xxx' declared here
+// CHECK-NOTES: [[@LINE-4]]:10: note: 'xxx' declared here
// CHECK-FIXES: C2 c2(/*xxx=*/0, 0);
}
diff --git a/clang-tools-extra/test/clang-tidy/check_clang_tidy.py b/clang-tools-extra/test/clang-tidy/check_clang_tidy.py
index 46fe0f6c8af..d1cefba3c75 100755
--- a/clang-tools-extra/test/clang-tidy/check_clang_tidy.py
+++ b/clang-tools-extra/test/clang-tidy/check_clang_tidy.py
@@ -165,7 +165,7 @@ def main():
if has_check_notes:
notes_file = temp_file_name + '.notes'
filtered_output = [line for line in clang_tidy_output.splitlines()
- if not "note: FIX-IT applied suggested changes" in line]
+ if not "note: FIX-IT applied" in line]
write_file(notes_file, '\n'.join(filtered_output))
try:
subprocess.check_output(
diff --git a/clang-tools-extra/test/clang-tidy/fuchsia-default-arguments.cpp b/clang-tools-extra/test/clang-tidy/fuchsia-default-arguments.cpp
index ce745651d50..23f269ad129 100644
--- a/clang-tools-extra/test/clang-tidy/fuchsia-default-arguments.cpp
+++ b/clang-tools-extra/test/clang-tidy/fuchsia-default-arguments.cpp
@@ -7,7 +7,7 @@ int foo(int value = 5) { return value; }
int f() {
foo();
// CHECK-NOTES: [[@LINE-1]]:3: warning: calling a function that uses a default argument is disallowed [fuchsia-default-arguments]
- // CHECK-NOTES: [[@LINE-8]]:9: note: default parameter was declared here
+ // CHECK-NOTES: [[@LINE-7]]:9: note: default parameter was declared here
}
int bar(int value) { return value; }
@@ -71,10 +71,10 @@ int main() {
S s;
s.x();
// CHECK-NOTES: [[@LINE-1]]:3: warning: calling a function that uses a default argument is disallowed [fuchsia-default-arguments]
- // CHECK-NOTES: [[@LINE-9]]:11: note: default parameter was declared here
+ // CHECK-NOTES: [[@LINE-8]]:11: note: default parameter was declared here
// CHECK-NEXT: void S::x(int i = 12) {}
x();
// CHECK-NOTES: [[@LINE-1]]:3: warning: calling a function that uses a default argument is disallowed [fuchsia-default-arguments]
- // CHECK-NOTES: [[@LINE-19]]:8: note: default parameter was declared here
+ // CHECK-NOTES: [[@LINE-18]]:8: note: default parameter was declared here
// CHECK-NEXT: void x(int i = 12);
}