aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting
diff options
context:
space:
mode:
Diffstat (limited to 'UnitTesting')
-rw-r--r--UnitTesting/GTMAppKitUnitTestingUtilities.h2
-rw-r--r--UnitTesting/GTMNSObject+BindingUnitTesting.h2
-rw-r--r--UnitTesting/GTMNSObject+BindingUnitTesting.m1
-rw-r--r--UnitTesting/GTMNSObject+UnitTesting.m2
-rw-r--r--UnitTesting/GTMUnitTestDevLog.h17
-rw-r--r--UnitTesting/GTMUnitTestDevLog.m6
-rw-r--r--UnitTesting/GTMUnitTestingBindingTest.m4
7 files changed, 20 insertions, 14 deletions
diff --git a/UnitTesting/GTMAppKitUnitTestingUtilities.h b/UnitTesting/GTMAppKitUnitTestingUtilities.h
index d6a653c..d29f63a 100644
--- a/UnitTesting/GTMAppKitUnitTestingUtilities.h
+++ b/UnitTesting/GTMAppKitUnitTestingUtilities.h
@@ -16,6 +16,8 @@
// the License.
//
+#import <AppKit/AppKit.h>
+
#import "GTMFoundationUnitTestingUtilities.h"
// Collection of utilities for unit testing
diff --git a/UnitTesting/GTMNSObject+BindingUnitTesting.h b/UnitTesting/GTMNSObject+BindingUnitTesting.h
index 55c3dfe..feac5b3 100644
--- a/UnitTesting/GTMNSObject+BindingUnitTesting.h
+++ b/UnitTesting/GTMNSObject+BindingUnitTesting.h
@@ -48,7 +48,7 @@ do { \
if (!isGood) { \
NSString *failString; \
GTM_FOREACH_OBJECT(failString, errors) { \
- if (description) { \
+ if (description != nil) { \
STFail(@"%@: %@", failString, STComposeString(description, ##__VA_ARGS__)); \
} else { \
STFail(@"%@", failString); \
diff --git a/UnitTesting/GTMNSObject+BindingUnitTesting.m b/UnitTesting/GTMNSObject+BindingUnitTesting.m
index 4718854..4b43f58 100644
--- a/UnitTesting/GTMNSObject+BindingUnitTesting.m
+++ b/UnitTesting/GTMNSObject+BindingUnitTesting.m
@@ -18,6 +18,7 @@
// the License.
//
+#import <AppKit/AppKit.h>
#import "GTMDefines.h"
#import "GTMNSObject+BindingUnitTesting.h"
#import "GTMSystemVersion.h"
diff --git a/UnitTesting/GTMNSObject+UnitTesting.m b/UnitTesting/GTMNSObject+UnitTesting.m
index 8529059..3796839 100644
--- a/UnitTesting/GTMNSObject+UnitTesting.m
+++ b/UnitTesting/GTMNSObject+UnitTesting.m
@@ -394,7 +394,7 @@ GTM_INLINE BOOL almostEqual(unsigned char a, unsigned char b) {
}
- (void)encodeBytes:(const uint8_t *)bytesp
- length:(unsigned)lenv
+ length:(NSUInteger)lenv
forKey:(NSString *)key {
[self checkForKey:key];
[dictionary_ setObject:[NSData dataWithBytes:bytesp
diff --git a/UnitTesting/GTMUnitTestDevLog.h b/UnitTesting/GTMUnitTestDevLog.h
index 30c7077..f80743a 100644
--- a/UnitTesting/GTMUnitTestDevLog.h
+++ b/UnitTesting/GTMUnitTestDevLog.h
@@ -33,8 +33,8 @@
@interface GTMUnitTestDevLog : NSObject
// Log a message
-+ (void)log:(NSString*)format, ...;
-+ (void)log:(NSString*)format args:(va_list)args;
++ (void)log:(NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
++ (void)log:(NSString*)format args:(va_list)args NS_FORMAT_FUNCTION(1,0);
// Turn tracking on/off
+ (void)enableTracking;
@@ -43,21 +43,24 @@
// Note that you are expecting a string that has an exact match. No need to
// escape any pattern characters.
-+ (void)expectString:(NSString *)format, ...;
++ (void)expectString:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);
// Note that you are expecting a pattern. Pattern characters that you want
// exact matches on must be escaped. See [GTMRegex escapedPatternForString].
// Patterns match across newlines (kGTMRegexOptionSupressNewlineSupport) making
// it easier to match output from the descriptions of NS collection types such
// as NSArray and NSDictionary.
-+ (void)expectPattern:(NSString *)format, ...;
++ (void)expectPattern:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);
// Note that you are expecting exactly 'n' strings
-+ (void)expect:(NSUInteger)n casesOfString:(NSString *)format, ...;
++ (void)expect:(NSUInteger)n
+ casesOfString:(NSString *)format, ... NS_FORMAT_FUNCTION(2,3);
// Note that you are expecting exactly 'n' patterns
-+ (void)expect:(NSUInteger)n casesOfPattern:(NSString*)format, ...;
-+ (void)expect:(NSUInteger)n casesOfPattern:(NSString*)format args:(va_list)args;
++ (void)expect:(NSUInteger)n
+ casesOfPattern:(NSString*)format, ... NS_FORMAT_FUNCTION(2,3);
++ (void)expect:(NSUInteger)n
+ casesOfPattern:(NSString*)format args:(va_list)args NS_FORMAT_FUNCTION(2,0);
// Call when you want to verify that you have matched all the logs you expect
// to match. If your unittests inherit from GTMTestcase (like they should) you
diff --git a/UnitTesting/GTMUnitTestDevLog.m b/UnitTesting/GTMUnitTestDevLog.m
index f2f9418..980fb93 100644
--- a/UnitTesting/GTMUnitTestDevLog.m
+++ b/UnitTesting/GTMUnitTestDevLog.m
@@ -199,7 +199,7 @@ static BOOL gTrackingEnabled = NO;
arguments:argList] autorelease];
va_end(argList);
NSString *pattern = [GTMRegex escapedPatternForString:string];
- [self expect:1 casesOfPattern:pattern];
+ [self expect:1 casesOfPattern:@"%@", pattern];
}
@@ -217,7 +217,7 @@ static BOOL gTrackingEnabled = NO;
arguments:argList] autorelease];
va_end(argList);
NSString *pattern = [GTMRegex escapedPatternForString:string];
- [self expect:n casesOfPattern:pattern];
+ [self expect:n casesOfPattern:@"%@", pattern];
}
+ (void)expect:(NSUInteger)n casesOfPattern:(NSString*)format, ... {
@@ -240,7 +240,7 @@ casesOfPattern:(NSString*)format
[patterns addObject:regex];
}
}
-}
+}
+ (void)verifyNoMoreLogsExpected {
@synchronized(self) {
diff --git a/UnitTesting/GTMUnitTestingBindingTest.m b/UnitTesting/GTMUnitTestingBindingTest.m
index 19ab5b0..26ae5df 100644
--- a/UnitTesting/GTMUnitTestingBindingTest.m
+++ b/UnitTesting/GTMUnitTestingBindingTest.m
@@ -102,14 +102,14 @@ NSString *const kGTMKeyThatIsntEqual = @"keyThatIsntEqual";
- (id)valueForKey:(NSString*)binding {
if ([binding isEqualTo:kGTMKeyWithNoValue]) {
- [NSException raise:NSUndefinedKeyException format:nil];
+ [NSException raise:NSUndefinedKeyException format:@""];
}
return @"foo";
}
- (void)setValue:(id)value forKey:(NSString*)binding {
if ([binding isEqualTo:kGTMKeyWeCantSet]) {
- [NSException raise:NSUndefinedKeyException format:nil];
+ [NSException raise:NSUndefinedKeyException format:@""];
}
}
@end