aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting
diff options
context:
space:
mode:
Diffstat (limited to 'UnitTesting')
-rw-r--r--UnitTesting/GTMSenTestCase.h4
-rw-r--r--UnitTesting/GTMSenTestCase.m3
2 files changed, 4 insertions, 3 deletions
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 <UIKit/UIKit.h>
#else
+#import <AppKit/AppKit.h> // 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;
}