aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting
diff options
context:
space:
mode:
authorGravatar thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-05-09 18:53:09 +0000
committerGravatar thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-05-09 18:53:09 +0000
commitf90bcf3263b80b96754977ddbd5309704cf817fb (patch)
tree585db4c1126cea3bd0ff9b338628d33febe36e59 /UnitTesting
parente5c365c04b9f2f6d04b2c5bd828f39fab2882e7d (diff)
Flush out suppport for 64bit, GC support.
Added some more xcode configs related to the above. Removed some classes that the unittesting doesn't need (and aren't able to support 64bit). add base64, httpfetcher, and progress monitor stream.
Diffstat (limited to 'UnitTesting')
-rw-r--r--UnitTesting/GTMAppKit+UnitTesting.m64
-rw-r--r--UnitTesting/GTMIPhoneUnitTestMain.m4
-rw-r--r--UnitTesting/GTMNSObject+BindingUnitTesting.m3
-rw-r--r--UnitTesting/GTMNSObject+UnitTesting.m118
-rw-r--r--UnitTesting/GTMUnitTestingBindingTest.m1
-rw-r--r--UnitTesting/GTMUnitTestingTest.m12
-rw-r--r--UnitTesting/GTMUnitTestingUtilities.m8
-rw-r--r--UnitTesting/TestData/GTMUIViewUnitTestingTest.gtmUTState (renamed from UnitTesting/GTMUIViewUnitTestingTest.gtmUTState)0
-rw-r--r--UnitTesting/TestData/GTMUIViewUnitTestingTest.png (renamed from UnitTesting/GTMUIViewUnitTestingTest.png)bin3214 -> 3214 bytes
-rw-r--r--UnitTesting/TestData/GTMUnitTestingImage.gtmUTState (renamed from UnitTesting/GTMUnitTestingImage.gtmUTState)0
-rw-r--r--UnitTesting/TestData/GTMUnitTestingImage.tiff (renamed from UnitTesting/GTMUnitTestingImage.tiff)bin67190 -> 67190 bytes
-rw-r--r--UnitTesting/TestData/GTMUnitTestingTest.nib/classes.nib (renamed from UnitTesting/GTMUnitTestingTest.nib/classes.nib)0
-rw-r--r--UnitTesting/TestData/GTMUnitTestingTest.nib/info.nib (renamed from UnitTesting/GTMUnitTestingTest.nib/info.nib)0
-rw-r--r--UnitTesting/TestData/GTMUnitTestingTest.nib/keyedobjects.nib (renamed from UnitTesting/GTMUnitTestingTest.nib/keyedobjects.nib)bin15667 -> 15667 bytes
-rw-r--r--UnitTesting/TestData/GTMUnitTestingTestApp.gtmUTState (renamed from UnitTesting/GTMUnitTestingTestApp.gtmUTState)288
-rw-r--r--UnitTesting/TestData/GTMUnitTestingView.tiff (renamed from UnitTesting/GTMUnitTestingView.tiff)bin161670 -> 161670 bytes
-rw-r--r--UnitTesting/TestData/GTMUnitTestingWindow.gtmUTState (renamed from UnitTesting/GTMUnitTestingWindow.gtmUTState)0
-rw-r--r--UnitTesting/TestData/GTMUnitTestingWindow.tiff (renamed from UnitTesting/GTMUnitTestingWindow.tiff)bin21226 -> 21226 bytes
18 files changed, 151 insertions, 347 deletions
diff --git a/UnitTesting/GTMAppKit+UnitTesting.m b/UnitTesting/GTMAppKit+UnitTesting.m
index 85f03a2..6cb5a8b 100644
--- a/UnitTesting/GTMAppKit+UnitTesting.m
+++ b/UnitTesting/GTMAppKit+UnitTesting.m
@@ -23,21 +23,34 @@
#import "GTMGeometryUtils.h"
#import "GTMMethodCheck.h"
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
+ #define ENCODE_NSINTEGER(coder, i, key) [(coder) encodeInt:(i) forKey:(key)]
+#else
+ #define ENCODE_NSINTEGER(coder, i, key) [(coder) encodeInteger:(i) forKey:(key)]
+#endif
+
@implementation NSApplication (GMUnitTestingAdditions)
GTM_METHOD_CHECK(NSObject, gtm_unitTestEncodeState:); // COV_NF_LINE
- (void)gtm_unitTestEncodeState:(NSCoder*)inCoder {
[super gtm_unitTestEncodeState:inCoder];
- [inCoder encodeInt:[[self mainWindow] windowNumber]
- forKey:@"ApplicationMainWindow"];
-
+ ENCODE_NSINTEGER(inCoder, [[self mainWindow] windowNumber], @"ApplicationMainWindow");
+
// Descend down into the windows allowing them to store their state
NSEnumerator *windowEnum = [[self windows] objectEnumerator];
NSWindow *window = nil;
int i = 0;
while ((window = [windowEnum nextObject])) {
- [inCoder encodeObject:window forKey:[NSString stringWithFormat:@"Window %d", i]];
- i = i + 1;
+ if ([window isVisible]) {
+ // Only record visible windows because invisible windows may be closing on us
+ // This appears to happen differently in 64 bit vs 32 bit, and items
+ // in the window may hold an extra retain count for a while until the
+ // event loop is spun. To avoid all this, we just don't record non
+ // visible windows.
+ // See rdar://5851458 for details.
+ [inCoder encodeObject:window forKey:[NSString stringWithFormat:@"Window %d", i]];
+ i = i + 1;
+ }
}
// and encode the menu bar
@@ -81,7 +94,7 @@ GTM_METHOD_CHECK(NSObject, gtm_unitTestEncodeState:); // COV_NF_LINE
[inCoder encodeObject:[self class] forKey:@"ControlType"];
[inCoder encodeObject:[self objectValue] forKey:@"ControlValue"];
[inCoder encodeObject:[self selectedCell] forKey:@"ControlSelectedCell"];
- [inCoder encodeInt:[self tag] forKey:@"ControlTag"];
+ ENCODE_NSINTEGER(inCoder, [self tag], @"ControlTag");
[inCoder encodeBool:[self isEnabled] forKey:@"ControlIsEnabled"];
}
@@ -117,8 +130,8 @@ GTM_METHOD_CHECK(NSObject, gtm_unitTestEncodeState:); // COV_NF_LINE
// is going to be in the CellValue encoding.
[inCoder encodeObject:[self title] forKey:@"CellTitle"];
}
- [inCoder encodeInt:[self state] forKey:@"CellState"];
- [inCoder encodeInt:[self tag] forKey:@"CellTag"];
+ ENCODE_NSINTEGER(inCoder, [self state], @"CellState");
+ ENCODE_NSINTEGER(inCoder, [self tag], @"CellTag");
}
@end
@@ -163,8 +176,19 @@ GTM_METHOD_CHECK(NSObject, gtm_unitTestEncodeState:); // COV_NF_LINE
// inCoder - the coder to encode our state into
- (void)gtm_unitTestEncodeState:(NSCoder*)inCoder {
[super gtm_unitTestEncodeState:inCoder];
- [inCoder encodeObject:[self title] forKey:@"MenuTitle"];
-
+ // Hack here to work around
+ // rdar://5881796 Application menu item title wrong when accessed programatically
+ // which causes us to have different results on x86_64 vs x386.
+ // Hack is braced intentionally. We don't record the title of the
+ // "application" menu or it's menu title because they are wrong on 32 bit.
+ // They appear to work right on 64bit.
+ {
+ NSMenu *mainMenu = [NSApp mainMenu];
+ NSMenu *appleMenu = [[mainMenu itemAtIndex:0] submenu];
+ if (![self isEqual:appleMenu]) {
+ [inCoder encodeObject:[self title] forKey:@"MenuTitle"];
+ }
+ }
// Descend down into the menuitems allowing them to store their state
NSEnumerator *menuItemEnum = [[self itemArray] objectEnumerator];
NSMenuItem *menuItem = nil;
@@ -179,15 +203,25 @@ GTM_METHOD_CHECK(NSObject, gtm_unitTestEncodeState:); // COV_NF_LINE
- (void)gtm_unitTestEncodeState:(NSCoder*)inCoder {
[super gtm_unitTestEncodeState:inCoder];
- [inCoder encodeObject:[self title] forKey:@"MenuItemTitle"];
+ // Hack here to work around
+ // rdar://5881796 Application menu item title wrong when accessed programatically
+ // which causes us to have different results on x86_64 vs x386.
+ // See comment above.
+ {
+ NSMenu *mainMenu = [NSApp mainMenu];
+ NSMenuItem *appleMenuItem = [mainMenu itemAtIndex:0];
+ if (![self isEqual:appleMenuItem]) {
+ [inCoder encodeObject:[self title] forKey:@"MenuItemTitle"];
+ }
+ }
[inCoder encodeObject:[self keyEquivalent] forKey:@"MenuItemKeyEquivalent"];
[inCoder encodeBool:[self isSeparatorItem] forKey:@"MenuItemIsSeparator"];
- [inCoder encodeInt:[self state] forKey:@"MenuItemState"];
+ ENCODE_NSINTEGER(inCoder, [self state], @"MenuItemState");
[inCoder encodeBool:[self isEnabled] forKey:@"MenuItemIsEnabled"];
[inCoder encodeBool:[self isAlternate] forKey:@"MenuItemIsAlternate"];
[inCoder encodeObject:[self toolTip] forKey:@"MenuItemTooltip"];
- [inCoder encodeInt:[self tag] forKey:@"MenuItemTag"];
- [inCoder encodeInt:[self indentationLevel] forKey:@"MenuItemIndentationLevel"];
+ ENCODE_NSINTEGER(inCoder, [self tag], @"MenuItemTag");
+ ENCODE_NSINTEGER(inCoder, [self indentationLevel], @"MenuItemIndentationLevel");
// Do our submenu if neccessary
if ([self hasSubmenu]) {
@@ -221,7 +255,7 @@ GTM_METHOD_CHECK(NSObject, gtm_unitTestEncodeState:); // COV_NF_LINE
return self;
}
-- (void) dealloc {
+- (void)dealloc {
[drawer_ release];
[super dealloc];
}
diff --git a/UnitTesting/GTMIPhoneUnitTestMain.m b/UnitTesting/GTMIPhoneUnitTestMain.m
index 2af060b..16a3907 100644
--- a/UnitTesting/GTMIPhoneUnitTestMain.m
+++ b/UnitTesting/GTMIPhoneUnitTestMain.m
@@ -43,11 +43,11 @@ static int MethodSort(const void *a, const void *b) {
@implementation GTMIPhoneUnitTestDelegate
// Return YES if class is subclass (1 or more generations) of SenTestCase
-- (BOOL)isTestFixture:(Class)class {
+- (BOOL)isTestFixture:(Class)aClass {
BOOL iscase = NO;
Class testCaseClass = [SenTestCase class];
Class superclass;
- for (superclass = class;
+ for (superclass = aClass;
!iscase && superclass;
superclass = class_getSuperclass(superclass)) {
iscase = superclass == testCaseClass ? YES : NO;
diff --git a/UnitTesting/GTMNSObject+BindingUnitTesting.m b/UnitTesting/GTMNSObject+BindingUnitTesting.m
index 03d723d..7773542 100644
--- a/UnitTesting/GTMNSObject+BindingUnitTesting.m
+++ b/UnitTesting/GTMNSObject+BindingUnitTesting.m
@@ -306,11 +306,14 @@ BOOL GTMDoExposedBindingsFunctionCorrectly(NSObject *object,
- (NSMutableDictionary*)gtm_unitTestExposedBindingsTestValues:(NSString*)binding {
NSMutableDictionary *dict = [super gtm_unitTestExposedBindingsTestValues:binding];
+#if !__LP64__
if ([binding isEqualToString:NSAlignmentBinding]) {
// rdar://5851491 - Setting NSAlignmentBinding of search field to NSCenterTextAlignment broken
+ // This appears to not be a bug in 64 bit. Strange.
[dict setObject:[NSNumber numberWithInt:NSNaturalTextAlignment]
forKey:[NSNumber numberWithInt:NSCenterTextAlignment]];
}
+#endif
return dict;
}
diff --git a/UnitTesting/GTMNSObject+UnitTesting.m b/UnitTesting/GTMNSObject+UnitTesting.m
index 6aff70c..34aeb58 100644
--- a/UnitTesting/GTMNSObject+UnitTesting.m
+++ b/UnitTesting/GTMNSObject+UnitTesting.m
@@ -202,6 +202,8 @@ BOOL GTMIsObjectStateEqualToStateNamed(id object,
- (NSString *)gtm_saveToPathForFileNamed:(NSString*)name
extension:(NSString*)extension;
- (CGImageRef)gtm_createUnitTestImage;
+// Returns nil if there is no override
+- (NSString *)gtm_getOverrideDefaultUnitTestSaveToDirectory;
@end
// This is a keyed coder for storing unit test state data. It is used only by
@@ -388,12 +390,17 @@ static NSString *gGTMUnitTestSaveToDirectory = nil;
stringByDeletingLastPathComponent]
stringByDeletingLastPathComponent]
stringByAppendingPathComponent:@"Desktop"];
-#else
+#else
NSArray *desktopDirs = NSSearchPathForDirectoriesInDomains(NSDesktopDirectory,
NSUserDomainMask,
YES);
gGTMUnitTestSaveToDirectory = [desktopDirs objectAtIndex:0];
#endif
+ // Did we get overridden?
+ NSString *override = [self gtm_getOverrideDefaultUnitTestSaveToDirectory];
+ if (override) {
+ gGTMUnitTestSaveToDirectory = override;
+ }
[gGTMUnitTestSaveToDirectory retain];
}
result = gGTMUnitTestSaveToDirectory;
@@ -402,6 +409,29 @@ static NSString *gGTMUnitTestSaveToDirectory = nil;
return result;
}
+// Return nil if there is no override
+- (NSString *)gtm_getOverrideDefaultUnitTestSaveToDirectory {
+ NSString *result = nil;
+
+ // If we have an environment variable that ends in "BUILD_NUMBER" odds are
+ // we're on an automated build system, so use the build products dir as an
+ // override instead of writing on the desktop.
+ NSDictionary *env = [[NSProcessInfo processInfo] environment];
+ NSEnumerator *enumerator = [env keyEnumerator];
+ NSString *key = nil;
+ while (((key = [enumerator nextObject]) != nil) &&
+ ![key hasSuffix:@"BUILD_NUMBER"])
+ ;
+ if (key) {
+ result = [env objectForKey:@"BUILT_PRODUCTS_DIR"];
+ }
+
+ if (result && [result length] == 0) {
+ result = nil;
+ }
+ return result;
+}
+
/// Find the path for a file named name.extension in your bundle.
// Searches for the following:
// "name.extension",
@@ -443,15 +473,33 @@ static NSString *gGTMUnitTestSaveToDirectory = nil;
systemVersions[2] = [NSString stringWithFormat:@".%d", major];
systemVersions[3] = @"";
NSString *extensions[2];
-#if GTM_IPHONE_SDK
+#if GTM_IPHONE_SDK
extensions[0] = @".iPhone";
-#else
- const NXArchInfo *localInfo = NXGetLocalArchInfo();
- _GTMDevAssert(localInfo && localInfo->name, @"Couldn't get NXArchInfo");
- const NXArchInfo *genericInfo = NXGetArchInfoFromCpuType(localInfo->cputype, 0);
- _GTMDevAssert(genericInfo && genericInfo->name, @"Couldn't get generic NXArchInfo");
- extensions[0] = [NSString stringWithFormat:@".%s", genericInfo->name];
-#endif
+#else // !GTM_IPHONE_SDK
+ // In reading arch(3) you'd thing this would work:
+ //
+ // const NXArchInfo *localInfo = NXGetLocalArchInfo();
+ // _GTMDevAssert(localInfo && localInfo->name, @"Couldn't get NXArchInfo");
+ // const NXArchInfo *genericInfo = NXGetArchInfoFromCpuType(localInfo->cputype, 0);
+ // _GTMDevAssert(genericInfo && genericInfo->name, @"Couldn't get generic NXArchInfo");
+ // extensions[0] = [NSString stringWithFormat:@".%s", genericInfo->name];
+ //
+ // but on 64bit it returns the same things as on 32bit, so...
+#if __POWERPC__
+ #if __LP64__
+ extensions[0] = @".ppc64";
+ #else // !__LP64__
+ extensions[0] = @".ppc";
+ #endif // __LP64__
+#else // !__POWERPC__
+ #if __LP64__
+ extensions[0] = @".x86_64";
+ #else // !__LP64__
+ extensions[0] = @".i386";
+ #endif // __LP64__
+#endif // !__POWERPC__
+
+#endif // GTM_IPHONE_SDK
extensions[1] = @"";
int i,j;
@@ -481,11 +529,29 @@ static NSString *gGTMUnitTestSaveToDirectory = nil;
#if GTM_IPHONE_SDK
system = "iPhone";
#else
- const NXArchInfo *localInfo = NXGetLocalArchInfo();
- _GTMDevAssert(localInfo && localInfo->name, @"Couldn't get NXArchInfo");
- const NXArchInfo *genericInfo = NXGetArchInfoFromCpuType(localInfo->cputype, 0);
- _GTMDevAssert(genericInfo && genericInfo->name, @"Couldn't get generic NXArchInfo");
- system = genericInfo->name;
+ // In reading arch(3) you'd thing this would work:
+ //
+ // const NXArchInfo *localInfo = NXGetLocalArchInfo();
+ // _GTMDevAssert(localInfo && localInfo->name, @"Couldn't get NXArchInfo");
+ // const NXArchInfo *genericInfo = NXGetArchInfoFromCpuType(localInfo->cputype, 0);
+ // _GTMDevAssert(genericInfo && genericInfo->name, @"Couldn't get generic NXArchInfo");
+ // system = genericInfo->name;
+ //
+ // but on 64bit it returns the same things as on 32bit, so...
+#if __POWERPC__
+ #if __LP64__
+ system = "ppc64";
+ #else // !__LP64__
+ system = "ppc";
+ #endif // __LP64__
+#else // !__POWERPC__
+ #if __LP64__
+ system = "x86_64";
+ #else // !__LP64__
+ system = "i386";
+ #endif // __LP64__
+#endif // !__POWERPC__
+
#endif
long major, minor, bugFix;
[GTMSystemVersion getMajor:&major minor:&minor bugFix:&bugFix];
@@ -530,7 +596,7 @@ static NSString *gGTMUnitTestSaveToDirectory = nil;
_GTMDevAssert(cs, @"Couldn't create colorspace");
CGBitmapInfo info = kCGImageAlphaPremultipliedLast | kCGBitmapByteOrderDefault;
if (data) {
- *data = calloc(bytesPerRow, height);
+ *data = (unsigned char*)calloc(bytesPerRow, height);
_GTMDevAssert(*data, @"Couldn't create bitmap");
}
context = CGBitmapContextCreate(data ? *data : NULL, width, height,
@@ -618,7 +684,7 @@ static NSString *gGTMUnitTestSaveToDirectory = nil;
NSDictionary *tiffDict = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:NSTIFFCompressionLZW]
forKey:(NSString*)kCGImagePropertyTIFFCompression];
NSDictionary *destProps = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithFloat:1.0],
+ [NSNumber numberWithFloat:1.0f],
(NSString*)kCGImageDestinationLossyCompressionQuality,
tiffDict,
(NSString*)kCGImagePropertyTIFFDictionary,
@@ -756,12 +822,12 @@ static NSString *gGTMUnitTestSaveToDirectory = nil;
_GTMDevAssert(diffContext, @"Can't make diff context");
size_t diffRowBytes = CGBitmapContextGetBytesPerRow(diffContext);
for (row = 0; row < imageHeight; row++) {
- unsigned long *imageRow = (unsigned long*)(imageData + imageBytesPerRow * row);
- unsigned long *fileRow = (unsigned long*)(fileData + fileBytesPerRow * row);
- unsigned long* diffRow = (unsigned long*)(diffData + diffRowBytes * row);
+ uint32_t *imageRow = (uint32_t*)(imageData + imageBytesPerRow * row);
+ uint32_t *fileRow = (uint32_t*)(fileData + fileBytesPerRow * row);
+ uint32_t* diffRow = (uint32_t*)(diffData + diffRowBytes * row);
for (col = 0; col < imageWidth; col++) {
- unsigned long imageColor = imageRow[col];
- unsigned long fileColor = fileRow[col];
+ uint32_t imageColor = imageRow[col];
+ uint32_t fileColor = fileRow[col];
unsigned char imageAlpha = imageColor & 0xF;
unsigned char imageBlue = imageColor >> 8 & 0xF;
@@ -783,12 +849,12 @@ static NSString *gGTMUnitTestSaveToDirectory = nil;
almostEqual(imageAlpha, fileAlpha);
answer &= equal;
if (diff) {
- unsigned long newColor;
+ uint32_t newColor;
if (equal) {
- newColor = (((unsigned long)imageRed) << 24) +
- (((unsigned long)imageGreen) << 16) +
- (((unsigned long)imageBlue) << 8) +
- (((unsigned long)imageAlpha) / 2);
+ newColor = (((uint32_t)imageRed) << 24) +
+ (((uint32_t)imageGreen) << 16) +
+ (((uint32_t)imageBlue) << 8) +
+ (((uint32_t)imageAlpha) / 2);
} else {
newColor = 0xFF0000FF;
}
diff --git a/UnitTesting/GTMUnitTestingBindingTest.m b/UnitTesting/GTMUnitTestingBindingTest.m
index c0ef93c..d27e8e7 100644
--- a/UnitTesting/GTMUnitTestingBindingTest.m
+++ b/UnitTesting/GTMUnitTestingBindingTest.m
@@ -48,6 +48,7 @@
NSWindow *window = [testWindowController window];
GTMTestExposedBindings(window, @"Window failed binding test");
[self doSubviewBindingTest:[window contentView]];
+ [window close];
[testWindowController release];
// Run a test against something with no bindings.
diff --git a/UnitTesting/GTMUnitTestingTest.m b/UnitTesting/GTMUnitTestingTest.m
index f152428..cc28a1a 100644
--- a/UnitTesting/GTMUnitTestingTest.m
+++ b/UnitTesting/GTMUnitTestingTest.m
@@ -204,18 +204,6 @@ NSString *const kGTMWindowSaveFileName = @"GTMUnitTestingWindow";
return field_;
}
-- (void)dealloc {
- NSWindow *window = [self window];
- int count = [window retainCount];
-
- // Spinning the run loop here to get rid of the window. Stupid issue
- // where there's a delayed selector holding a retain count on our window
- // rdar://5851458 - Closing a window with a NSTextView in it should get rid of it immediately
- while (count == [window retainCount]) {
- [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]];
- }
- [super dealloc];
-}
@end
@implementation GTMUnitTestingDelegate
diff --git a/UnitTesting/GTMUnitTestingUtilities.m b/UnitTesting/GTMUnitTestingUtilities.m
index 7c1b915..a37b7dd 100644
--- a/UnitTesting/GTMUnitTestingUtilities.m
+++ b/UnitTesting/GTMUnitTestingUtilities.m
@@ -54,8 +54,8 @@ static void RestoreColorProfile(void);
// Sets up the user interface so that we can run consistent UI unittests on it.
+ (void)setUpForUIUnitTests {
// Give some names to undocumented defaults values
- static const int MediumFontSmoothing = 2;
- static const int BlueTintedAppearance = 1;
+ const NSInteger MediumFontSmoothing = 2;
+ const NSInteger BlueTintedAppearance = 1;
// This sets up some basic values that we want as our defaults for doing pixel
// based user interface tests. These defaults only apply to the unit test app,
@@ -78,7 +78,7 @@ static void RestoreColorProfile(void);
// Use english plz
[defaults setObject:[NSArray arrayWithObject:@"en"] forKey:@"AppleLanguages"];
// How fast should we draw sheets. This speeds up the sheet tests considerably
- [defaults setFloat:.001 forKey:@"NSWindowResizeTime"];
+ [defaults setFloat:.001f forKey:@"NSWindowResizeTime"];
// Switch over the screen profile to "generic rgb". This installs an
// atexit handler to return our profile back when we are done.
SetColorProfileToGenericRGB();
@@ -111,7 +111,7 @@ BOOL AreCMProfilesEqual(CMProfileRef a, CMProfileRef b) {
static void RestoreColorProfile(void) {
if (gCurrentColorProfile) {
CGDirectDisplayID displayID = CGMainDisplayID();
- int error = CMSetProfileByAVID((UInt32)displayID, gCurrentColorProfile);
+ CMError error = CMSetProfileByAVID((UInt32)displayID, gCurrentColorProfile);
if (error) {
// COV_NF_START
// No way to force this case in a unittest.
diff --git a/UnitTesting/GTMUIViewUnitTestingTest.gtmUTState b/UnitTesting/TestData/GTMUIViewUnitTestingTest.gtmUTState
index 87ae9e5..87ae9e5 100644
--- a/UnitTesting/GTMUIViewUnitTestingTest.gtmUTState
+++ b/UnitTesting/TestData/GTMUIViewUnitTestingTest.gtmUTState
diff --git a/UnitTesting/GTMUIViewUnitTestingTest.png b/UnitTesting/TestData/GTMUIViewUnitTestingTest.png
index 03fd9f0..03fd9f0 100644
--- a/UnitTesting/GTMUIViewUnitTestingTest.png
+++ b/UnitTesting/TestData/GTMUIViewUnitTestingTest.png
Binary files differ
diff --git a/UnitTesting/GTMUnitTestingImage.gtmUTState b/UnitTesting/TestData/GTMUnitTestingImage.gtmUTState
index 969ddf6..969ddf6 100644
--- a/UnitTesting/GTMUnitTestingImage.gtmUTState
+++ b/UnitTesting/TestData/GTMUnitTestingImage.gtmUTState
diff --git a/UnitTesting/GTMUnitTestingImage.tiff b/UnitTesting/TestData/GTMUnitTestingImage.tiff
index 4d08297..4d08297 100644
--- a/UnitTesting/GTMUnitTestingImage.tiff
+++ b/UnitTesting/TestData/GTMUnitTestingImage.tiff
Binary files differ
diff --git a/UnitTesting/GTMUnitTestingTest.nib/classes.nib b/UnitTesting/TestData/GTMUnitTestingTest.nib/classes.nib
index cc51f67..cc51f67 100644
--- a/UnitTesting/GTMUnitTestingTest.nib/classes.nib
+++ b/UnitTesting/TestData/GTMUnitTestingTest.nib/classes.nib
diff --git a/UnitTesting/GTMUnitTestingTest.nib/info.nib b/UnitTesting/TestData/GTMUnitTestingTest.nib/info.nib
index 3fb1618..3fb1618 100644
--- a/UnitTesting/GTMUnitTestingTest.nib/info.nib
+++ b/UnitTesting/TestData/GTMUnitTestingTest.nib/info.nib
diff --git a/UnitTesting/GTMUnitTestingTest.nib/keyedobjects.nib b/UnitTesting/TestData/GTMUnitTestingTest.nib/keyedobjects.nib
index d3104e2..d3104e2 100644
--- a/UnitTesting/GTMUnitTestingTest.nib/keyedobjects.nib
+++ b/UnitTesting/TestData/GTMUnitTestingTest.nib/keyedobjects.nib
Binary files differ
diff --git a/UnitTesting/GTMUnitTestingTestApp.gtmUTState b/UnitTesting/TestData/GTMUnitTestingTestApp.gtmUTState
index 1b7c4e5..03e611c 100644
--- a/UnitTesting/GTMUnitTestingTestApp.gtmUTState
+++ b/UnitTesting/TestData/GTMUnitTestingTestApp.gtmUTState
@@ -256,13 +256,9 @@
<key>MenuItemTitle</key>
<string></string>
</dict>
- <key>MenuTitle</key>
- <string>Apple</string>
</dict>
<key>MenuItemTag</key>
<integer>0</integer>
- <key>MenuItemTitle</key>
- <string></string>
</dict>
<key>MenuItem 1</key>
<dict>
@@ -1482,290 +1478,6 @@
<key>CellTag</key>
<integer>0</integer>
<key>CellTitle</key>
- <string>Foo</string>
- <key>CellValue</key>
- <string>Foo</string>
- </dict>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSTextField</string>
- <key>ControlValue</key>
- <string>Foo</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- <key>ViewSubView 5</key>
- <dict>
- <key>ControlIsEnabled</key>
- <true/>
- <key>ControlSelectedCell</key>
- <dict>
- <key>CellState</key>
- <integer>1</integer>
- <key>CellTag</key>
- <integer>0</integer>
- <key>CellTitle</key>
- <string>CheckMate!</string>
- <key>CellValue</key>
- <string>1</string>
- </dict>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSButton</string>
- <key>ControlValue</key>
- <string>1</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- <key>ViewSubView 6</key>
- <dict>
- <key>ControlIsEnabled</key>
- <true/>
- <key>ControlSelectedCell</key>
- <dict>
- <key>CellState</key>
- <integer>1</integer>
- <key>CellTag</key>
- <integer>0</integer>
- <key>CellTitle</key>
- <string></string>
- <key>CellValue</key>
- <string>50</string>
- </dict>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSSlider</string>
- <key>ControlValue</key>
- <string>50</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- <key>ViewSubView 7</key>
- <dict>
- <key>ControlIsEnabled</key>
- <true/>
- <key>ControlSelectedCell</key>
- <dict>
- <key>CellState</key>
- <integer>0</integer>
- <key>CellTag</key>
- <integer>0</integer>
- <key>CellTitle</key>
- <string>Cancel</string>
- <key>CellValue</key>
- <string>0</string>
- </dict>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSButton</string>
- <key>ControlValue</key>
- <string>0</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- <key>ViewSubView 8</key>
- <dict>
- <key>ControlIsEnabled</key>
- <true/>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSColorWell</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- <key>ViewSubView 9</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- </dict>
- <key>WindowIsMain</key>
- <false/>
- <key>WindowIsVisible</key>
- <false/>
- <key>WindowTitle</key>
- <string>Window</string>
- </dict>
- <key>Window 1</key>
- <dict>
- <key>WindowContent</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- <key>ViewSubView 0</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- <key>ViewSubView 0</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- <key>ViewSubView 0</key>
- <dict>
- <key>ControlIsEnabled</key>
- <true/>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSTableView</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- </dict>
- <key>ViewSubView 1</key>
- <dict>
- <key>ControlIsEnabled</key>
- <false/>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSScroller</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- <key>ViewSubView 2</key>
- <dict>
- <key>ControlIsEnabled</key>
- <false/>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSScroller</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- <key>ViewSubView 3</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- <key>ViewSubView 0</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- </dict>
- <key>ViewSubView 4</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- </dict>
- <key>ViewSubView 1</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- <key>ViewSubView 10</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- <key>ViewSubView 0</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- <key>ViewSubView 0</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- </dict>
- <key>ViewSubView 1</key>
- <dict>
- <key>ControlIsEnabled</key>
- <false/>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSScroller</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- <key>ViewSubView 2</key>
- <dict>
- <key>ControlIsEnabled</key>
- <false/>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSScroller</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- </dict>
- <key>ViewSubView 11</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- <key>ViewSubView 0</key>
- <dict>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- </dict>
- <key>ViewSubView 2</key>
- <dict>
- <key>ControlIsEnabled</key>
- <true/>
- <key>ControlSelectedCell</key>
- <dict>
- <key>CellState</key>
- <integer>0</integer>
- <key>CellTag</key>
- <integer>0</integer>
- <key>CellTitle</key>
- <string>HaHa</string>
- <key>CellValue</key>
- <string>HaHa</string>
- </dict>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSTextField</string>
- <key>ControlValue</key>
- <string>HaHa</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- <key>ViewSubView 3</key>
- <dict>
- <key>ControlIsEnabled</key>
- <true/>
- <key>ControlSelectedCell</key>
- <dict>
- <key>CellState</key>
- <integer>0</integer>
- <key>CellTag</key>
- <integer>0</integer>
- <key>CellTitle</key>
- <string>Still Haven't Found What I'm Searching For</string>
- <key>CellValue</key>
- <string>Still Haven't Found What I'm Searching For</string>
- </dict>
- <key>ControlTag</key>
- <integer>0</integer>
- <key>ControlType</key>
- <string>NSSearchField</string>
- <key>ControlValue</key>
- <string>Still Haven't Found What I'm Searching For</string>
- <key>ViewIsHidden</key>
- <false/>
- </dict>
- <key>ViewSubView 4</key>
- <dict>
- <key>ControlIsEnabled</key>
- <true/>
- <key>ControlSelectedCell</key>
- <dict>
- <key>CellState</key>
- <integer>1</integer>
- <key>CellTag</key>
- <integer>0</integer>
- <key>CellTitle</key>
<string>Once upon a time</string>
<key>CellValue</key>
<string>Once upon a time</string>
diff --git a/UnitTesting/GTMUnitTestingView.tiff b/UnitTesting/TestData/GTMUnitTestingView.tiff
index 228df73..228df73 100644
--- a/UnitTesting/GTMUnitTestingView.tiff
+++ b/UnitTesting/TestData/GTMUnitTestingView.tiff
Binary files differ
diff --git a/UnitTesting/GTMUnitTestingWindow.gtmUTState b/UnitTesting/TestData/GTMUnitTestingWindow.gtmUTState
index 27dd08e..27dd08e 100644
--- a/UnitTesting/GTMUnitTestingWindow.gtmUTState
+++ b/UnitTesting/TestData/GTMUnitTestingWindow.gtmUTState
diff --git a/UnitTesting/GTMUnitTestingWindow.tiff b/UnitTesting/TestData/GTMUnitTestingWindow.tiff
index 63f5649..63f5649 100644
--- a/UnitTesting/GTMUnitTestingWindow.tiff
+++ b/UnitTesting/TestData/GTMUnitTestingWindow.tiff
Binary files differ