From ee96eba5fd4929f251855009121803b70a48f2d2 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Wed, 11 Nov 2009 15:00:55 +0000 Subject: [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) --- Foundation/GTMLoggerTest.m | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Foundation/GTMLoggerTest.m') 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 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 -- cgit v1.2.3