From 0a1e63215324bdc7379e49ed2c9c6dee7f43a6b0 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Mon, 2 Nov 2009 19:35:10 +0000 Subject: [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) --- AppKit/GTMIBArrayTest.m | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'AppKit/GTMIBArrayTest.m') 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 -- cgit v1.2.3