diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-11-11 15:00:55 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-11-11 15:00:55 +0000 |
commit | ee96eba5fd4929f251855009121803b70a48f2d2 (patch) | |
tree | 0b97a986995483d7f11ecef5fdbe6716c3d4c6a3 | |
parent | dd4c1c15b5f4f178f55942ca6ffa63027fcb20df (diff) |
[Author: thomasvl]
We still have a bunch that doesn't work on 10.6, but this fixes some things:
Update the logger test to handle the format change on 10.6.
Update the AppleScript test to handle the 10.6 behaviors.
Fix typo in the StackTraceTest.
R=dmaclach
DELTA=26 (18 added, 0 deleted, 8 changed)
-rw-r--r-- | Foundation/GTMLoggerTest.m | 16 | ||||
-rw-r--r-- | Foundation/GTMNSAppleScript+HandlerTest.m | 18 | ||||
-rw-r--r-- | Foundation/GTMStackTraceTest.m | 4 |
3 files changed, 28 insertions, 10 deletions
diff --git a/Foundation/GTMLoggerTest.m b/Foundation/GTMLoggerTest.m index 86ced5e..5b354cb 100644 --- a/Foundation/GTMLoggerTest.m +++ b/Foundation/GTMLoggerTest.m @@ -19,6 +19,7 @@ #import "GTMLogger.h" #import "GTMRegex.h" #import "GTMSenTestCase.h" +#import "GTMSystemVersion.h" // A test writer that stores log messages in an array for easy retrieval. @@ -379,9 +380,18 @@ id<GTMLogFormatter> fmtr = [[[GTMLogStandardFormatter alloc] init] autorelease]; STAssertNotNil(fmtr, nil); - // E.g. 2008-01-04 09:16:26.906 otest[5567/0xa07d0f60] [lvl=1] (no func) test - NSString * kFormatBasePattern = - @"[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3} ((otest)|(GTMiPhoneTest))\\[[0-9]+/0x[0-9a-f]+\\] \\[lvl=[0-3]\\] \\(no func\\) "; + NSString * kFormatBasePattern; + if ([GTMSystemVersion isSnowLeopardOrGreater]) { + // E.g. 2009-10-26 22:26:25.086 otest-i386[53200/0xa0438500] [lvl=1] (no func) test + kFormatBasePattern = + @"[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3} ((otest-i386)|(otest-x86_64)|(GTMiPhoneTest))\\[[0-9]+/0x[0-9a-f]+\\] \\[lvl=[0-3]\\] \\(no func\\) "; + } else { + // E.g. 2008-01-04 09:16:26.906 otest[5567/0xa07d0f60] [lvl=1] (no func) test + kFormatBasePattern = + @"[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3} ((otest)|(GTMiPhoneTest))\\[[0-9]+/0x[0-9a-f]+\\] \\[lvl=[0-3]\\] \\(no func\\) "; + } + + NSString *msg = nil; msg = [self stringFromFormatter:fmtr diff --git a/Foundation/GTMNSAppleScript+HandlerTest.m b/Foundation/GTMNSAppleScript+HandlerTest.m index dc310dc..e7d4ecc 100644 --- a/Foundation/GTMNSAppleScript+HandlerTest.m +++ b/Foundation/GTMNSAppleScript+HandlerTest.m @@ -286,7 +286,7 @@ @"testadd", @"testgetscript", nil]; - if ([GTMSystemVersion isBuildEqualTo:kGTMSystemBuild10_6_0_WWDC]) { + if ([GTMSystemVersion isSnowLeopardOrGreater]) { // Workaround for bug in SnowLeopard // rdar://66688601 OSAGetHandlersNames returns names in camelcase instead // of smallcaps. @@ -328,8 +328,8 @@ NSSet *properties = [script gtm_properties]; NSSet *expected = [NSSet setWithObjects: - @"testscriptproperty", - @"parenttestscriptproperty", + @"testscriptproperty", + @"parenttestscriptproperty", @"foo", @"testscript", @"parenttestscript", @@ -358,11 +358,19 @@ [GTMFourCharCode fourCharCodeWithFourCharCode:pASHours], [GTMFourCharCode fourCharCodeWithFourCharCode:pASTab], nil]; - if ([GTMSystemVersion isBuildEqualTo:kGTMSystemBuild10_6_0_WWDC]) { + if ([GTMSystemVersion isSnowLeopardOrGreater]) { // Workaround for bug in SnowLeopard // rdar://6289077 OSAGetPropertyNames returns names in camelcase instead // of lowercase. - properties = [properties valueForKey:@"lowercaseString"]; + id obj; + NSMutableSet *properties2 = [NSMutableSet set]; + GTM_FOREACH_OBJECT(obj, properties) { + if ([obj isKindOfClass:[NSString class]]) { + obj = [obj lowercaseString]; + } + [properties2 addObject:obj]; + } + properties = properties2; } STAssertEqualObjects(properties, expected, @"Unexpected properties?"); id value = [script gtm_valueForProperty:@"testScriptProperty"]; diff --git a/Foundation/GTMStackTraceTest.m b/Foundation/GTMStackTraceTest.m index 0739122..385457a 100644 --- a/Foundation/GTMStackTraceTest.m +++ b/Foundation/GTMStackTraceTest.m @@ -67,7 +67,7 @@ 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 symble at depth %lu", lp); + STAssertNotNULL(descs[lp].symbol, @"didn't get a symbol at depth %lu", lp); } // Do it again, but don't give it enough space (to make sure it handles that) @@ -78,7 +78,7 @@ 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 symble at depth %lu", lp); + STAssertNotNULL(descs[lp].symbol, @"didn't get a symbol at depth %lu", lp); } } |