Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Commit

Permalink
Use our constant instead of the system header one to avoid a deprecat…
Browse files Browse the repository at this point in the history
…ed 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

git-svn-id: http://google-toolbox-for-mac.googlecode.com/svn/trunk@688 7dc7ac4e-7543-0410-b95c-c1676fc8e2a3
  • Loading branch information
gtm.daemon committed Sep 22, 2014
1 parent 9c601c3 commit 247e9fa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions UnitTesting/GTMCodeCoverageApp.h
Expand Up @@ -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"

Expand Down
13 changes: 12 additions & 1 deletion UnitTesting/GTMCodeCoverageTestsXC.m
Expand Up @@ -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

Expand All @@ -53,7 +61,7 @@ - (void)stopObserving {

// Reset defaults back to what they should be.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults removeObjectForKey:XCTestObserverClassKey];
[defaults removeObjectForKey:GTMXCTestObserverClassKey];
}

+ (void)load {
Expand All @@ -65,10 +73,13 @@ + (void)load {
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;
Expand Down

0 comments on commit 247e9fa

Please sign in to comment.