mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-05 14:11:00 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38802 72102866-910b-0410-8b05-ffd578937521
21 lines
647 B
Objective-C
21 lines
647 B
Objective-C
#import "ObjectTesting.h"
|
|
#import <GNUstepBase/NSHashTable+GNUstepBase.h>
|
|
#import <Foundation/NSArray.h>
|
|
#import <Foundation/NSAutoreleasePool.h>
|
|
|
|
|
|
int main()
|
|
{
|
|
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
|
NSHashTable *obj = [[NSHashTable new] autorelease];
|
|
NSString *strA = @"a";
|
|
NSString *strB = @"b";
|
|
NSArray *a = [NSArray arrayWithObjects: strA, strB, strA, nil];
|
|
[obj addObjectsFromArray: a];
|
|
PASS([obj count] == 2, "-addObjectsFromArray: adds objects ignoring duplicates");
|
|
PASS([obj containsObject: strA] && [obj containsObject: strB], "Table contains correct objects");
|
|
|
|
[arp release]; arp = nil;
|
|
return 0;
|
|
}
|
|
|