aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting/GTMAppKit+UnitTesting.m
diff options
context:
space:
mode:
authorGravatar thomasvl@gmail.com <thomasvl@gmail.com@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-01-09 20:34:30 +0000
committerGravatar thomasvl@gmail.com <thomasvl@gmail.com@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-01-09 20:34:30 +0000
commit4fd103b5de98d2f469b982677ea389e7ee7d64b3 (patch)
treed0eb379fdc78996bc2e201515d26c7521d1fc8dc /UnitTesting/GTMAppKit+UnitTesting.m
parent84d1232477f398339e48ea504c45048e9328ef9b (diff)
- turned off _debug framework support in tests since we now capture a lot more
in log validation. - Added GTM_SUPPORT_GC for controlling the inclusion of GC related code. - If you are using GTMUnitTestDevLog, it also tries to capture logs from NSAssert. - Added GTM_FOREACH_OBJECT/GTM_FOREACH_KEY that uses NSEnumerator and objectEnumerator/keyEnumerator on 10.4, but on 10.5+/iPhone uses FastEnumeration. - GTMNSWorkspace+Running gives a variety of ways of determining the attributes of running processes.
Diffstat (limited to 'UnitTesting/GTMAppKit+UnitTesting.m')
-rw-r--r--UnitTesting/GTMAppKit+UnitTesting.m14
1 files changed, 7 insertions, 7 deletions
diff --git a/UnitTesting/GTMAppKit+UnitTesting.m b/UnitTesting/GTMAppKit+UnitTesting.m
index 0e21491..23c44e3 100644
--- a/UnitTesting/GTMAppKit+UnitTesting.m
+++ b/UnitTesting/GTMAppKit+UnitTesting.m
@@ -37,10 +37,9 @@ GTM_METHOD_CHECK(NSObject, gtm_unitTestEncodeState:);
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])) {
+ GTM_FOREACH_OBJECT(window, [self windows]) {
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
@@ -190,10 +189,12 @@ GTM_METHOD_CHECK(NSObject, gtm_unitTestEncodeState:);
}
}
// Descend down into the menuitems allowing them to store their state
- NSEnumerator *menuItemEnum = [[self itemArray] objectEnumerator];
NSMenuItem *menuItem = nil;
- for (int i = 0; (menuItem = [menuItemEnum nextObject]); ++i) {
- [inCoder encodeObject:menuItem forKey:[NSString stringWithFormat:@"MenuItem %d", i]];
+ int i = 0;
+ GTM_FOREACH_OBJECT(menuItem, [self itemArray]) {
+ [inCoder encodeObject:menuItem
+ forKey:[NSString stringWithFormat:@"MenuItem %d", i]];
+ ++i;
}
}
@@ -324,10 +325,9 @@ GTM_METHOD_CHECK(NSObject, gtm_unitTestEncodeState:);
[super gtm_unitTestEncodeState:inCoder];
[inCoder encodeBool:[self isHidden] forKey:@"ViewIsHidden"];
if ([self gtm_shouldEncodeStateForSubviews]) {
- NSEnumerator *subviewEnum = [[self subviews] objectEnumerator];
NSView *subview = nil;
int i = 0;
- while ((subview = [subviewEnum nextObject])) {
+ GTM_FOREACH_OBJECT(subview, [self subviews]) {
[inCoder encodeObject:subview forKey:[NSString stringWithFormat:@"ViewSubView %d", i]];
i = i + 1;
}