aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/test/clang-tidy/checkers/google/objc-avoid-nsobject-new.m
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/checkers/google/objc-avoid-nsobject-new.m')
-rw-r--r--clang-tools-extra/test/clang-tidy/checkers/google/objc-avoid-nsobject-new.m8
1 files changed, 4 insertions, 4 deletions
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