mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Implement +addObjectsFromArray: on NSHashTable
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38802 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8e93dc85d3
commit
46d97b3be0
6 changed files with 124 additions and 0 deletions
21
Tests/base/NSHashTable/additions.m
Normal file
21
Tests/base/NSHashTable/additions.m
Normal file
|
@ -0,0 +1,21 @@
|
|||
#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;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue