aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2012-07-24 22:00:34 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2012-07-24 22:00:34 +0000
commit7dc2640a750b547a3513d35715c0c59efb58c15a (patch)
tree8f8fee3f38803e1aa0993c250fc94ce7bd40187d
parent569b21e129c67a5191e1c81d4e2f9114c46a736c (diff)
[Author: dmaclach]
Some more google toolbox cleanup. TBR=thomasvl DELTA=25 (6 added, 2 deleted, 17 changed)
-rw-r--r--Foundation/GTMNSScanner+JSONTest.m38
-rw-r--r--Foundation/GTMStackTraceTest.m6
-rw-r--r--UnitTesting/GTMIPhoneSecurityLibraryTest.m4
-rw-r--r--UnitTesting/GTMSenTestCase.h2
-rw-r--r--UnitTesting/GTMSenTestCase.m2
5 files changed, 28 insertions, 24 deletions
diff --git a/Foundation/GTMNSScanner+JSONTest.m b/Foundation/GTMNSScanner+JSONTest.m
index 08f5db1..8085148 100644
--- a/Foundation/GTMNSScanner+JSONTest.m
+++ b/Foundation/GTMNSScanner+JSONTest.m
@@ -6,9 +6,9 @@
// 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
@@ -75,7 +75,7 @@ struct {
- (void)testJSONObject {
NSCharacterSet *set = [[NSCharacterSet illegalCharacterSet] invertedSet];
for (size_t i = 0; i < sizeof(testStrings) / sizeof(testStrings[0]); ++i) {
- NSScanner *scanner
+ NSScanner *scanner
= [NSScanner scannerWithString:testStrings[i].testString_];
[scanner setCharactersToBeSkipped:set];
NSString *array = nil;
@@ -86,23 +86,27 @@ struct {
BOOL goodObject = [scanner gtm_scanJSONObjectString:&object];
if (testStrings[i].resultString_) {
if (testStrings[i].isObject_) {
- STAssertEqualStrings(testStrings[i].resultString_,
- object, @"Test String: %@", testStrings[i]);
- STAssertNil(array, @"Test String: %@", testStrings[i]);
- STAssertTrue(goodObject, @"Test String: %@", testStrings[i]);
- STAssertFalse(goodArray, @"Test String: %@", testStrings[i]);
+ STAssertEqualStrings(testStrings[i].resultString_,
+ object, @"Test String: %@",
+ testStrings[i].testString_);
+ STAssertNil(array, @"Test String: %@", testStrings[i].testString_);
+ STAssertTrue(goodObject, @"Test String: %@",
+ testStrings[i].testString_);
+ STAssertFalse(goodArray, @"Test String: %@",
+ testStrings[i].testString_);
} else {
- STAssertEqualStrings(testStrings[i].resultString_, array,
- @"Test String: %@", testStrings[i]);
- STAssertNil(object, @"Test String: %@", testStrings[i]);
- STAssertTrue(goodArray, @"Test String: %@", testStrings[i]);
- STAssertFalse(goodObject, @"Test String: %@", testStrings[i]);
+ STAssertEqualStrings(testStrings[i].resultString_, array,
+ @"Test String: %@", testStrings[i].testString_);
+ STAssertNil(object, @"Test String: %@", testStrings[i].testString_);
+ STAssertTrue(goodArray, @"Test String: %@", testStrings[i].testString_);
+ STAssertFalse(goodObject, @"Test String: %@",
+ testStrings[i].testString_);
}
} else {
- STAssertNil(object, @"Test String: %@", testStrings[i]);
- STAssertNil(array, @"Test String: %@", testStrings[i]);
- STAssertFalse(goodArray, @"Test String: %@", testStrings[i]);
- STAssertFalse(goodObject, @"Test String: %@", testStrings[i]);
+ STAssertNil(object, @"Test String: %@", testStrings[i].testString_);
+ STAssertNil(array, @"Test String: %@", testStrings[i].testString_);
+ STAssertFalse(goodArray, @"Test String: %@", testStrings[i].testString_);
+ STAssertFalse(goodObject, @"Test String: %@", testStrings[i].testString_);
}
}
}
diff --git a/Foundation/GTMStackTraceTest.m b/Foundation/GTMStackTraceTest.m
index ab29213..a581c76 100644
--- a/Foundation/GTMStackTraceTest.m
+++ b/Foundation/GTMStackTraceTest.m
@@ -67,7 +67,8 @@
STAssertGreaterThan(depth, (size_t)4, nil);
// All that we got have symbols
for (NSUInteger lp = 0 ; lp < depth ; ++lp) {
- STAssertNotNULL(descs[lp].symbol, @"didn't get a symbol at depth %lu", lp);
+ STAssertNotNULL(descs[lp].symbol, @"didn't get a symbol at depth %lu",
+ (unsigned long)lp);
}
// Do it again, but don't give it enough space (to make sure it handles that)
@@ -78,7 +79,8 @@
STAssertLessThan(depth, fullDepth, nil);
// All that we got have symbols
for (NSUInteger lp = 0 ; lp < depth ; ++lp) {
- STAssertNotNULL(descs[lp].symbol, @"didn't get a symbol at depth %lu", lp);
+ STAssertNotNULL(descs[lp].symbol, @"didn't get a symbol at depth %lu",
+ (unsigned long)lp);
}
}
diff --git a/UnitTesting/GTMIPhoneSecurityLibraryTest.m b/UnitTesting/GTMIPhoneSecurityLibraryTest.m
index 951ca98..f6fd37a 100644
--- a/UnitTesting/GTMIPhoneSecurityLibraryTest.m
+++ b/UnitTesting/GTMIPhoneSecurityLibraryTest.m
@@ -62,8 +62,8 @@ static NSString * const kPassword = @"GTMTestingSecurityPassword";
OSStatus result = SecItemAdd((CFDictionaryRef)passwordItem, NULL);
STAssertTrue(result == noErr || result == errSecDuplicateItem,
- @"Unexpected result code: %d",
- result);
+ @"Unexpected result code: %lu",
+ (unsigned long)result);
[self assertCorrectPassword];
// Test that accessing the keychain will continue to work after a delay.
diff --git a/UnitTesting/GTMSenTestCase.h b/UnitTesting/GTMSenTestCase.h
index 3dac15b..f59fac8 100644
--- a/UnitTesting/GTMSenTestCase.h
+++ b/UnitTesting/GTMSenTestCase.h
@@ -60,7 +60,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-NSString *STComposeString(NSString *, ...);
+NSString *STComposeString(NSString *, ...) NS_FORMAT_FUNCTION(1, 2);
#ifdef __cplusplus
}
#endif
diff --git a/UnitTesting/GTMSenTestCase.m b/UnitTesting/GTMSenTestCase.m
index 4906c19..5607c31 100644
--- a/UnitTesting/GTMSenTestCase.m
+++ b/UnitTesting/GTMSenTestCase.m
@@ -198,8 +198,6 @@
@end
-NSString *STComposeString(NSString *formatString, ...) NS_FORMAT_FUNCTION(1, 2);
-
NSString *STComposeString(NSString *formatString, ...) {
NSString *reason = @"";
if (formatString) {