diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-06-02 17:36:03 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-06-02 17:36:03 +0000 |
commit | 0608b15caa35831a16aa7e5fd1490df24dd01784 (patch) | |
tree | d36c1f14713752cc077b6afe320c0e9123618293 /AppKit/GTMNSImage+ScalingTest.m | |
parent | a470905a1dffcc61761dc49be13c2d1c8761d0d1 (diff) |
[Author: dmaclach]
Cleans up builds of GTM on Snow Leopard with gcc 4.2.
Cleans up iPhone configs
Adds libgcov for Snow Leopard
Fixes up some small bugs.
R=thomasvl
DELTA=2028 (972 added, 990 deleted, 66 changed)
Diffstat (limited to 'AppKit/GTMNSImage+ScalingTest.m')
-rw-r--r-- | AppKit/GTMNSImage+ScalingTest.m | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/AppKit/GTMNSImage+ScalingTest.m b/AppKit/GTMNSImage+ScalingTest.m index dddd00f..426e21b 100644 --- a/AppKit/GTMNSImage+ScalingTest.m +++ b/AppKit/GTMNSImage+ScalingTest.m @@ -49,7 +49,7 @@ STAssertNotNil([testImage gtm_representationOfSize:NSMakeSize(32, 32)], nil); NSImage *duplicate = [testImage gtm_duplicateOfSize:NSMakeSize(48, 48)]; - bestRepRect = NSMakeRect(0, 0, 50, 50); + bestRepRect = NSMakeRect(0, 0, 48, 48); #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 rep = [duplicate bestRepresentationForRect:bestRepRect context:nil @@ -60,6 +60,24 @@ STAssertTrue(NSEqualSizes([rep size], NSMakeSize(48, 48)), @"Size is %@", NSStringFromSize([rep size])); + // This should IMHO return 48,48 on both 10.6 and 10.5. It makes no sense + // at all that it returns 32,32 on 10_6 when the above code works for 48,48. + // rdar://8052200 "NSImage bestRepresentationForRect:context:hints: doesn't + // return the best rep" + // http://openradar.appspot.com/radar?id=394401 + bestRepRect = NSMakeRect(0, 0, 50, 50); +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 + rep = [duplicate bestRepresentationForRect:bestRepRect + context:nil + hints:nil]; + STAssertFalse(NSEqualSizes([rep size], NSMakeSize(48, 48)), + @"Size is %@", NSStringFromSize([rep size])); +#else + rep = [duplicate gtm_bestRepresentationForSize:bestRepRect.size]; + STAssertTrue(NSEqualSizes([rep size], NSMakeSize(48, 48)), + @"Size is %@", NSStringFromSize([rep size])); +#endif // MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 + } @end |