diff options
Diffstat (limited to 'UnitTesting')
-rw-r--r-- | UnitTesting/GTMNSObject+BindingUnitTesting.m | 22 | ||||
-rw-r--r-- | UnitTesting/GTMUnitTestDevLog.h | 5 | ||||
-rw-r--r-- | UnitTesting/GTMUnitTestDevLog.m | 16 | ||||
-rw-r--r-- | UnitTesting/TestData/GTMUnitTestingWindow.10.5.6.tiff | bin | 0 -> 21176 bytes |
4 files changed, 34 insertions, 9 deletions
diff --git a/UnitTesting/GTMNSObject+BindingUnitTesting.m b/UnitTesting/GTMNSObject+BindingUnitTesting.m index 1ce1c88..7a14ad6 100644 --- a/UnitTesting/GTMNSObject+BindingUnitTesting.m +++ b/UnitTesting/GTMNSObject+BindingUnitTesting.m @@ -374,7 +374,8 @@ BOOL GTMDoExposedBindingsFunctionCorrectly(NSObject *object, SInt32 major, minor, bugFix; [GTMSystemVersion getMajor:&major minor:&minor bugFix:&bugFix]; if (major <= 10 && minor <= 5 && bugFix <= 5) { - // rdar://5849154 - NSScroller exposes binding with no value class for NSValueBinding + // rdar://5849154 - NSScroller exposes binding with no value + // class for NSValueBinding [array addObject:NSValueBinding]; } if ([GTMSystemVersion isBuildLessThanOrEqualTo:kGTMSystemBuild10_6_0_WWDC]) { @@ -404,10 +405,12 @@ BOOL GTMDoExposedBindingsFunctionCorrectly(NSObject *object, NSMutableArray *array = [super gtm_unitTestExposedBindingsTestValues:binding]; if ([binding isEqualToString:NSAlignmentBinding]) { if ([GTMSystemVersion isBuildLessThanOrEqualTo:kGTMSystemBuild10_6_0_WWDC]) { - // rdar://5851487 - If NSAlignmentBinding for a NSTextField is set to -1 and then got it returns 7 + // rdar://5851487 - If NSAlignmentBinding for a NSTextField is set to -1 + // and then got it returns 7 + NSNumber *textAlignment = [NSNumber numberWithInt:NSNaturalTextAlignment]; GTMBindingUnitTestData *dataToRemove = [GTMBindingUnitTestData testWithValue:[NSNumber numberWithInt:-1] - expecting:[NSNumber numberWithInt:NSNaturalTextAlignment]]; + expecting:textAlignment]; [array removeObject:dataToRemove]; GTMBindingUnitTestData *dataToAdd = [GTMBindingUnitTestData testWithValue:[NSNumber numberWithInt:-1] @@ -428,9 +431,10 @@ BOOL GTMDoExposedBindingsFunctionCorrectly(NSObject *object, NSMutableArray *array = [super gtm_unitTestExposedBindingsToIgnore]; SInt32 major, minor, bugFix; [GTMSystemVersion getMajor:&major minor:&minor bugFix:&bugFix]; - if (major <= 10 && minor <= 5 && bugFix <= 5) { - // rdar://5851491 - Setting NSAlignmentBinding of search field to NSCenterTextAlignment broken - // Broken on 10.5.5 and below. + if (major <= 10 && minor <= 5 && bugFix <= 6) { + // rdar://5851491 - Setting NSAlignmentBinding of search field to + // NSCenterTextAlignment broken + // Broken on 10.5.6 and below. [array addObject:NSAlignmentBinding]; } // Not KVC Compliant @@ -504,7 +508,8 @@ BOOL GTMDoExposedBindingsFunctionCorrectly(NSObject *object, - (NSMutableArray*)gtm_unitTestExposedBindingsToIgnore { NSMutableArray *array = [super gtm_unitTestExposedBindingsToIgnore]; if ([GTMSystemVersion isBuildLessThanOrEqualTo:kGTMSystemBuild10_6_0_WWDC]) { - //rdar://5849335 - NSTextView only partially KVC compliant for key NSAttributedStringBinding + //rdar://5849335 - NSTextView only partially KVC compliant for key + // NSAttributedStringBinding [array addObject:NSAttributedStringBinding]; } // Not KVC Compliant @@ -524,7 +529,8 @@ BOOL GTMDoExposedBindingsFunctionCorrectly(NSObject *object, - (NSMutableArray*)gtm_unitTestExposedBindingsToIgnore { NSMutableArray *array = [super gtm_unitTestExposedBindingsToIgnore]; if ([GTMSystemVersion isBuildLessThanOrEqualTo:kGTMSystemBuild10_6_0_WWDC]) { - // rdar://5849248 - NSTabView exposes binding with no value class for NSSelectedIdentifierBinding + // rdar://5849248 - NSTabView exposes binding with no value class + // for NSSelectedIdentifierBinding [array addObject:NSSelectedIdentifierBinding]; } // Not KVC Compliant diff --git a/UnitTesting/GTMUnitTestDevLog.h b/UnitTesting/GTMUnitTestDevLog.h index 55ec44c..d88ef2e 100644 --- a/UnitTesting/GTMUnitTestDevLog.h +++ b/UnitTesting/GTMUnitTestDevLog.h @@ -67,4 +67,7 @@ + (void)resetExpectedLogs; @end - +// Does the same as GTMUnitTestDevLog, but the logs are only expected in debug. +// ie-the expect requests don't count in release builds. +@interface GTMUnitTestDevLogDebug : GTMUnitTestDevLog +@end diff --git a/UnitTesting/GTMUnitTestDevLog.m b/UnitTesting/GTMUnitTestDevLog.m index a0c31b3..227eb11 100644 --- a/UnitTesting/GTMUnitTestDevLog.m +++ b/UnitTesting/GTMUnitTestDevLog.m @@ -185,3 +185,19 @@ casesOfPattern:(NSString*)format } } @end + + +@implementation GTMUnitTestDevLogDebug + ++ (void)expect:(NSUInteger)n +casesOfPattern:(NSString*)format + args:(va_list)args { +#if DEBUG + // In debug, let the base work happen + [super expect:n casesOfPattern:format args:args]; +#else + // nothing when not in debug +#endif +} + +@end diff --git a/UnitTesting/TestData/GTMUnitTestingWindow.10.5.6.tiff b/UnitTesting/TestData/GTMUnitTestingWindow.10.5.6.tiff Binary files differnew file mode 100644 index 0000000..9179576 --- /dev/null +++ b/UnitTesting/TestData/GTMUnitTestingWindow.10.5.6.tiff |