diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-11-02 19:35:10 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-11-02 19:35:10 +0000 |
commit | 0a1e63215324bdc7379e49ed2c9c6dee7f43a6b0 (patch) | |
tree | a247b74fbd7bfe4f7418584fa4074094a3e8433a /AppKit/GTMIBArrayTest.m | |
parent | e1c938bc73510d64b908408bf404eb10a419001e (diff) |
[Author: thomasvl]
Fix up GTMIBArray to work with 10.6 nib loading. Nib loading on 10.6
pushes all objects into hash maps, which caused the IBArray to latch
on to its empty state, so this provides overrides so they maintain
the contacts around hash and isEqual, but can't be loaded from a nib.
R=dmaclach,stuartmorgan
DELTA=68 (68 added, 0 deleted, 0 changed)
Diffstat (limited to 'AppKit/GTMIBArrayTest.m')
-rw-r--r-- | AppKit/GTMIBArrayTest.m | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/AppKit/GTMIBArrayTest.m b/AppKit/GTMIBArrayTest.m index c4908b3..45ad3fb 100644 --- a/AppKit/GTMIBArrayTest.m +++ b/AppKit/GTMIBArrayTest.m @@ -292,6 +292,33 @@ STAssertTrue([fieldsSet isSubsetOfSet:everythingSet], nil); } +- (void)testIsEqual { + GTMIBArray *ibArray1 = + [[[IBArrayTestHelper alloc] initWithObj1:@"a" + obj2:@"b" + obj3:@"c" + obj4:@"d" + obj5:@"e"] autorelease]; + GTMIBArray *ibArray2 = + [[[IBArrayTestHelper alloc] initWithObj1:@"f" + obj2:@"g" + obj3:@"h" + obj4:@"i" + obj5:@"j"] autorelease]; + + STAssertEquals([ibArray1 hash], [ibArray2 hash], nil); + STAssertNotEqualObjects(ibArray1, ibArray2, nil); + + NSArray *ibArray1Prime = [[ibArray1 copy] autorelease]; + NSArray *ibArray2Prime = [[ibArray2 copy] autorelease]; + + STAssertTrue(ibArray1 != ibArray1Prime, nil); + STAssertTrue(ibArray2 != ibArray2Prime, nil); + STAssertNotEqualObjects(ibArray1Prime, ibArray2Prime, nil); + STAssertEqualObjects(ibArray1, ibArray1Prime, nil); + STAssertEqualObjects(ibArray2, ibArray2Prime, nil); +} + @end @implementation GTMIBArrayTestWindowController |