diff options
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/checkers/google')
3 files changed, 16 insertions, 14 deletions
diff --git a/clang-tools-extra/test/clang-tidy/checkers/google/build-explicit-make-pair.cpp b/clang-tools-extra/test/clang-tidy/checkers/google/build-explicit-make-pair.cpp index 94d5462..ea77272 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/google/build-explicit-make-pair.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/google/build-explicit-make-pair.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy --match-partial-fixes %s google-build-explicit-make-pair %t +// RUN: %check_clang_tidy %s google-build-explicit-make-pair %t namespace std { template <class T1, class T2> @@ -17,7 +17,7 @@ void templ(T a, T b) { std::make_pair<T, unsigned>(a, b); std::make_pair<int, int>(1, 2); // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: for C++11-compatibility, omit template arguments from make_pair -// CHECK-FIXES: std::make_pair(1, 2) +// CHECK-FIXES: std::make_pair(1, 2); } template <typename T> @@ -26,15 +26,15 @@ int t(); void test(int i) { std::make_pair<int, int>(i, i); // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: for C++11-compatibility, omit template arguments from make_pair -// CHECK-FIXES: std::make_pair(i, i) +// CHECK-FIXES: std::make_pair(i, i); std::make_pair<unsigned, int>(i, i); // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: for C++11-compatibility, use pair directly -// CHECK-FIXES: std::pair<unsigned, int>(i, i) +// CHECK-FIXES: std::pair<unsigned, int>(i, i); std::make_pair<int, unsigned>(i, i); // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: for C++11-compatibility, use pair directly -// CHECK-FIXES: std::pair<int, unsigned>(i, i) +// CHECK-FIXES: std::pair<int, unsigned>(i, i); #define M std::make_pair<int, unsigned>(i, i); M diff --git a/clang-tools-extra/test/clang-tidy/checkers/google/objc-avoid-nsobject-new.m b/clang-tools-extra/test/clang-tidy/checkers/google/objc-avoid-nsobject-new.m index f62af8f..9d02702 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/google/objc-avoid-nsobject-new.m +++ b/clang-tools-extra/test/clang-tidy/checkers/google/objc-avoid-nsobject-new.m @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy --match-partial-fixes %s google-objc-avoid-nsobject-new %t +// RUN: %check_clang_tidy %s google-objc-avoid-nsobject-new %t @interface NSObject + (instancetype)new; @@ -25,18 +25,18 @@ void CheckSpecificInitRecommendations(void) { NSObject *object = [NSObject new]; // CHECK-MESSAGES: [[@LINE-1]]:22: warning: do not create objects with +new [google-objc-avoid-nsobject-new] - // CHECK-FIXES: [NSObject alloc] init]; + // CHECK-FIXES: NSObject *object = {{[[][[]}}NSObject alloc] init]; NSDate *correctDate = [NSDate date]; NSDate *incorrectDate = [NSDate new]; // CHECK-MESSAGES: [[@LINE-1]]:27: warning: do not create objects with +new [google-objc-avoid-nsobject-new] - // CHECK-FIXES: [NSDate date]; + // CHECK-FIXES: NSDate *incorrectDate = [NSDate date]; NSObject *macroCreated = ALLOCATE_OBJECT(NSObject); // Shouldn't warn on macros. NSMutableDictionary *dict = [NSMutableDictionary<NSString *, NSString *> new]; // CHECK-MESSAGES: [[@LINE-1]]:31: warning: do not create objects with +new [google-objc-avoid-nsobject-new] - // CHECK-FIXES: [NSMutableDictionary<NSString *, NSString *> alloc] init]; + // CHECK-FIXES: NSMutableDictionary *dict = {{[[][[]}}NSMutableDictionary<NSString *, NSString *> alloc] init]; } @interface Foo : NSObject diff --git a/clang-tools-extra/test/clang-tidy/checkers/google/upgrade-googletest-case.cpp b/clang-tools-extra/test/clang-tidy/checkers/google/upgrade-googletest-case.cpp index cf24d2d..edb11b9 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/google/upgrade-googletest-case.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/google/upgrade-googletest-case.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy --match-partial-fixes %s google-upgrade-googletest-case %t -- -- -I%S/Inputs +// RUN: %check_clang_tidy %s google-upgrade-googletest-case %t -- -- -I%S/Inputs // RUN: %check_clang_tidy -check-suffix=NOSUITE %s google-upgrade-googletest-case %t -- -- -DNOSUITE -I%S/Inputs/gtest/nosuite #include "gtest/gtest.h" @@ -89,12 +89,14 @@ public: // CHECK-FIXES: static void TearDownTestSuite(); }; -template <typename T> void FooTypedTest<T>::SetUpTestCase() {} -// CHECK-MESSAGES: [[@LINE-1]]:45: warning: Google Test APIs named with 'case' +template <typename T> +void FooTypedTest<T>::SetUpTestCase() {} +// CHECK-MESSAGES: [[@LINE-1]]:23: warning: Google Test APIs named with 'case' // CHECK-FIXES: void FooTypedTest<T>::SetUpTestSuite() {} -template <typename T> void FooTypedTest<T>::TearDownTestCase() {} -// CHECK-MESSAGES: [[@LINE-1]]:45: warning: Google Test APIs named with 'case' +template <typename T> +void FooTypedTest<T>::TearDownTestCase() {} +// CHECK-MESSAGES: [[@LINE-1]]:23: warning: Google Test APIs named with 'case' // CHECK-FIXES: void FooTypedTest<T>::TearDownTestSuite() {} class BarTest : public testing::Test { |