diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2014-09-22 13:00:10 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2014-09-22 13:00:10 +0000 |
commit | 83c885459621bef62ba1809ff2b47b61413dea02 (patch) | |
tree | 004e7f8129976523285e21f1a20e22b3bb6a87bd /UnitTesting | |
parent | fa49c3a534194d2b39f00c9b035cd0f4c26a2064 (diff) |
Use our constant instead of the system header one to avoid a deprecated warning.
Turn off deprecated warnings when we do have to use the symbols.
DELTA=17 (16 added, 0 deleted, 1 changed)
DELTA_BY_EXTENSION=h=5,m=12
Diffstat (limited to 'UnitTesting')
-rw-r--r-- | UnitTesting/GTMCodeCoverageApp.h | 5 | ||||
-rw-r--r-- | UnitTesting/GTMCodeCoverageTestsXC.m | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/UnitTesting/GTMCodeCoverageApp.h b/UnitTesting/GTMCodeCoverageApp.h index a487d40..8c4ab7e 100644 --- a/UnitTesting/GTMCodeCoverageApp.h +++ b/UnitTesting/GTMCodeCoverageApp.h @@ -35,6 +35,11 @@ #define GTM_USING_XCTEST 0 #endif +// NOTE: As of Xcode 6, Apple made XCTestObserver and XCTestLog deprecated without +// having a replacement. Things still seem to work, but there doesn't seem to be a +// different way yet to hook when the tests finish. +// radr/18395261 - XCTestObserver deprecated with no replacement + #define GTMXCTestObserverClassKey @"XCTestObserverClass" #define GTMXCTestLogClass @"XCTestLog" diff --git a/UnitTesting/GTMCodeCoverageTestsXC.m b/UnitTesting/GTMCodeCoverageTestsXC.m index b960c26..a5db186 100644 --- a/UnitTesting/GTMCodeCoverageTestsXC.m +++ b/UnitTesting/GTMCodeCoverageTestsXC.m @@ -34,8 +34,16 @@ extern void __gcov_flush(); +// NOTE: As of Xcode 6, Apple made XCTestObserver and XCTestLog deprecated without +// having a replacement. Things still seem to work, but there doesn't seem to be a +// different way yet to hook when the tests finish. +// radr/18395261 - XCTestObserver deprecated with no replacement + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" @interface GTMCodeCoverageTests : XCTestObserver @end +#pragma clang diagnostic pop @implementation GTMCodeCoverageTests @@ -53,7 +61,7 @@ extern void __gcov_flush(); // Reset defaults back to what they should be. NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - [defaults removeObjectForKey:XCTestObserverClassKey]; + [defaults removeObjectForKey:GTMXCTestObserverClassKey]; } + (void)load { @@ -65,10 +73,13 @@ extern void __gcov_flush(); selfClass); mustExit = YES; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" if (![GTMXCTestObserverClassKey isEqual:XCTestObserverClassKey]) { NSLog(@"Apple has changed %@ to %@", GTMXCTestObserverClassKey, XCTestObserverClassKey); mustExit = YES; } +#pragma clang diagnostic pop if (!NSClassFromString(GTMXCTestLogClass)) { NSLog(@"Apple has gotten rid of the log class %@", GTMXCTestLogClass); mustExit = YES; |