diff options
author | Anna Zaks <ganna@apple.com> | 2015-08-08 04:53:04 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2015-08-08 04:53:04 +0000 |
commit | 9592df79019f8fc77fa6ff68bed63689e7b24eb0 (patch) | |
tree | 72edc0990f381d3fecb657b0ba8da7b634ac8d5a /clang/test/Analysis/localization.m | |
parent | 08f3c1e12ac46e0ff55ed3c67c09cc2c432ea726 (diff) | |
download | bcm5719-llvm-9592df79019f8fc77fa6ff68bed63689e7b24eb0.tar.gz bcm5719-llvm-9592df79019f8fc77fa6ff68bed63689e7b24eb0.zip |
Revert "[analyzer] Add checkers for OS X / iOS localizability issues"
This reverts commit fc885033a30b6e30ccf82398ae7c30e646727b10.
Revert all localization checker commits until the proper fix is implemented.
llvm-svn: 244394
Diffstat (limited to 'clang/test/Analysis/localization.m')
-rw-r--r-- | clang/test/Analysis/localization.m | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/clang/test/Analysis/localization.m b/clang/test/Analysis/localization.m deleted file mode 100644 index 83ba1e6f24b..00000000000 --- a/clang/test/Analysis/localization.m +++ /dev/null @@ -1,86 +0,0 @@ -// RUN: %clang_cc1 -analyze -fblocks -analyzer-store=region -analyzer-checker=alpha.osx.cocoa.NonLocalizedStringChecker -analyzer-checker=alpha.osx.cocoa.EmptyLocalizationContextChecker -verify %s - -// The larger set of tests in located in localization.m. These are tests -// specific for non-aggressive reporting. - -// These declarations were reduced using Delta-Debugging from Foundation.h -// on Mac OS X. - -#define nil ((id)0) -#define NSLocalizedString(key, comment) \ - [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil] -#define NSLocalizedStringFromTable(key, tbl, comment) \ - [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:(tbl)] -#define NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) \ - [bundle localizedStringForKey:(key) value:@"" table:(tbl)] -#define NSLocalizedStringWithDefaultValue(key, tbl, bundle, val, comment) \ - [bundle localizedStringForKey:(key) value:(val) table:(tbl)] -@interface NSObject -+ (id)alloc; -- (id)init; -@end -@interface NSString : NSObject -@end -@interface NSBundle : NSObject -+ (NSBundle *)mainBundle; -- (NSString *)localizedStringForKey:(NSString *)key - value:(NSString *)value - table:(NSString *)tableName; -@end -@interface UILabel : NSObject -@property(nullable, nonatomic, copy) NSString *text; -@end -@interface TestObject : NSObject -@property(strong) NSString *text; -@end - -@interface LocalizationTestSuite : NSObject -int random(); -@end - -// Test cases begin here -@implementation LocalizationTestSuite - -// An object passed in as an parameter's string member -// should not be considered unlocalized -- (void)testObjectAsArgument:(TestObject *)argumentObject { - UILabel *testLabel = [[UILabel alloc] init]; - - [testLabel setText:[argumentObject text]]; // no-warning - [testLabel setText:argumentObject.text]; // no-warning -} - -- (void)testLocalizationErrorDetectedOnPathway { - UILabel *testLabel = [[UILabel alloc] init]; - NSString *bar = NSLocalizedString(@"Hello", @"Comment"); - - if (random()) { - bar = @"Unlocalized string"; - } - - [testLabel setText:bar]; // expected-warning {{String should be localized}} -} - -- (void)testOneCharacterStringsDoNotGiveAWarning { - UILabel *testLabel = [[UILabel alloc] init]; - NSString *bar = NSLocalizedString(@"Hello", @"Comment"); - - if (random()) { - bar = @"-"; - } - - [testLabel setText:bar]; // no-warning -} - -- (void)testOneCharacterUTFStringsDoNotGiveAWarning { - UILabel *testLabel = [[UILabel alloc] init]; - NSString *bar = NSLocalizedString(@"Hello", @"Comment"); - - if (random()) { - bar = @"—"; - } - - [testLabel setText:bar]; // no-warning -} - -@end |