From fa33445a5ad223b7c4f69c1ddee3ab2503716eed Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Wed, 23 Jan 2013 03:12:37 +0000 Subject: Fixup for the testing helper for OS X: - Get NSImage defined. - Add framework to linking. --- UnitTesting/GTMSenTestCase.h | 4 ++-- UnitTesting/GTMSenTestCase.m | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'UnitTesting') diff --git a/UnitTesting/GTMSenTestCase.h b/UnitTesting/GTMSenTestCase.h index 683dc76..55cd813 100644 --- a/UnitTesting/GTMSenTestCase.h +++ b/UnitTesting/GTMSenTestCase.h @@ -1081,9 +1081,9 @@ GTM_EXTERN NSString *const SenTestLineNumberKey; #endif // GTM_IPHONE_SDK && !GTM_IPHONE_USE_SENTEST #if GTM_IPHONE_SDK - @class UIImage; - +#else +@class NSImage; #endif // GTM_IPHONE_SDK // All unittest cases in GTM should inherit from GTMTestCase. It makes sure diff --git a/UnitTesting/GTMSenTestCase.m b/UnitTesting/GTMSenTestCase.m index 4a7ae8f..fbd8659 100644 --- a/UnitTesting/GTMSenTestCase.m +++ b/UnitTesting/GTMSenTestCase.m @@ -29,6 +29,7 @@ #if GTM_IPHONE_SDK #import #else +#import // For NSImage #import "GTMGarbageCollection.h" #endif // GTM_IPHONE_SDK @@ -436,7 +437,7 @@ static int MethodSort(id a, id b, void *context) { - (NSImage *)imageFromResource:(NSString *)resource { NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSString *path = [bundle pathForResource:resource ofType:nil]; - NSImage *image = [NSImage imageWithContentsOfFile:path]; + NSImage *image = [[NSImage alloc] initWithContentsOfFile:path]; STAssertNotNil(image, @"Could not load image from resource: %@", path); return image; } -- cgit v1.2.3