aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting
diff options
context:
space:
mode:
authorGravatar dmaclach <dmaclach@gmail.com>2018-11-13 20:48:36 -0800
committerGravatar GitHub <noreply@github.com>2018-11-13 20:48:36 -0800
commit07dc0ac0b68b69b9e23e07126b02be9b35937154 (patch)
treed76f9d1af480b1310e39834d3518876c4173838b /UnitTesting
parentacc00b258aeef17cff7c8326c28945dd1aec071c (diff)
Remove unused GTMUnitTestDevLog. (#203)
It wasn't being used anywhere.
Diffstat (limited to 'UnitTesting')
-rw-r--r--UnitTesting/GTMSenTestCase.h4
-rw-r--r--UnitTesting/GTMUnitTestDevLog.h31
-rw-r--r--UnitTesting/GTMUnitTestDevLog.m108
3 files changed, 1 insertions, 142 deletions
diff --git a/UnitTesting/GTMSenTestCase.h b/UnitTesting/GTMSenTestCase.h
index 475e2f4..dad549c 100644
--- a/UnitTesting/GTMSenTestCase.h
+++ b/UnitTesting/GTMSenTestCase.h
@@ -1282,9 +1282,7 @@ GTM_EXTERN NSString *const SenTestLineNumberKey;
#endif // GTM_IPHONE_SDK && !GTM_USING_XCTEST
-// All unittest cases in GTM should inherit from GTMTestCase. It makes sure
-// to set up our logging system correctly to verify logging calls.
-// See GTMUnitTestDevLog.h for details
+// All unittest cases in GTM should inherit from GTMTestCase.
#if GTM_USING_XCTEST
@interface GTMTestCase : XCTestCase
#else
diff --git a/UnitTesting/GTMUnitTestDevLog.h b/UnitTesting/GTMUnitTestDevLog.h
deleted file mode 100644
index 35d5e0d..0000000
--- a/UnitTesting/GTMUnitTestDevLog.h
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// GTMUnitTestDevLog.h
-//
-// Copyright 2008 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy
-// of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-//
-
-#import <Foundation/Foundation.h>
-#import "GTMDefines.h"
-
-// GTMUnitTestDevLog modifies assertion logs so they don't get trapped by
-// build systems.
-
-@interface GTMUnitTestDevLog : NSObject
-
-// Turn tracking on/off
-+ (void)enableTracking;
-+ (void)disableTracking;
-
-@end
diff --git a/UnitTesting/GTMUnitTestDevLog.m b/UnitTesting/GTMUnitTestDevLog.m
deleted file mode 100644
index ae4050f..0000000
--- a/UnitTesting/GTMUnitTestDevLog.m
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// GTMUnitTestDevLog.m
-//
-// Copyright 2008 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy
-// of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-//
-
-#import "GTMUnitTestDevLog.h"
-
-@interface GTMUnttestDevLogAssertionHandler : NSAssertionHandler
-- (void)handleFailure:(NSString *)functionName
- file:(NSString *)fileName
- lineNumber:(NSInteger)line
- description:(NSString *)format
- arguments:(va_list)argList NS_FORMAT_FUNCTION(4,0);
-@end
-
-@implementation GTMUnttestDevLogAssertionHandler
-- (void)handleFailureInMethod:(SEL)selector
- object:(id)object
- file:(NSString *)fileName
- lineNumber:(NSInteger)line
- description:(NSString *)format, ... {
- NSString *call = [NSString stringWithFormat:@"[%@ %@]",
- NSStringFromClass([object class]),
- NSStringFromSelector(selector)];
-
- va_list argList;
- va_start(argList, format);
- [self handleFailure:call
- file:fileName
- lineNumber:line
- description:format
- arguments:argList];
- va_end(argList);
-}
-
-- (void)handleFailureInFunction:(NSString *)functionName
- file:(NSString *)fileName
- lineNumber:(NSInteger)line
- description:(NSString *)format, ... {
- va_list argList;
- va_start(argList, format);
- [self handleFailure:functionName
- file:fileName
- lineNumber:line
- description:format
- arguments:argList];
- va_end(argList);
-}
-
-- (void)handleFailure:(NSString *)failure
- file:(NSString *)fileName
- lineNumber:(NSInteger)line
- description:(NSString *)format
- arguments:(va_list)argList {
- NSString *descStr
- = [[[NSString alloc] initWithFormat:format arguments:argList] autorelease];
-
- // You need a format that will be useful in logs, but won't trip up Xcode or
- // any other build systems parsing of the output.
- NSString *outLog
- = [NSString stringWithFormat:@"RecordedNSAssert in %@ - %@ (%@:%ld)",
- failure, descStr, fileName, (long)line];
- // To avoid unused variable warning when _GTMDevLog is stripped.
- (void)outLog;
- _GTMDevLog(@"%@", outLog); // Don't want any percents in outLog honored
- [NSException raise:NSInternalInconsistencyException
- format:@"NSAssert raised"];
-}
-@end
-
-@implementation GTMUnitTestDevLog
-
-+ (void)enableTracking {
-
- NSMutableDictionary *threadDictionary
- = [[NSThread currentThread] threadDictionary];
- if ([threadDictionary objectForKey:@"NSAssertionHandler"] != nil) {
- NSLog(@"Warning: replacing NSAssertionHandler to capture assertions");
- }
-
- // Install an assertion handler to capture those.
- GTMUnttestDevLogAssertionHandler *handler =
- [[[GTMUnttestDevLogAssertionHandler alloc] init] autorelease];
- [threadDictionary setObject:handler forKey:@"NSAssertionHandler"];
-}
-
-+ (void)disableTracking {
-
- // Clear our assertion handler back out.
- NSMutableDictionary *threadDictionary
- = [[NSThread currentThread] threadDictionary];
- [threadDictionary removeObjectForKey:@"NSAssertionHandler"];
-}
-
-@end