import testsuite

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32187 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-02-16 08:21:17 +00:00
parent 734c214892
commit 0e02133729
374 changed files with 20864 additions and 0 deletions

View file

@ -0,0 +1,20 @@
#import "ObjectTesting.h"
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSMapTable.h>
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSMapTable *testObj;
testObj = [[NSMapTable new] autorelease];
[testObj setObject: @"hello" forKey: @"there"];
test_alloc(@"NSMapTable");
test_NSObject(@"NSMapTable", [NSArray arrayWithObject: testObj]);
test_NSCopying(@"NSMapTable",@"NSMapTable",
[NSArray arrayWithObject: testObj], NO, YES);
// test_NSCoding([NSArray arrayWithObject: testObj]);
[arp release]; arp = nil;
return 0;
}

View file

@ -0,0 +1,36 @@
#import "ObjectTesting.h"
#import <Foundation/NSMapTable.h>
#import <Foundation/NSAutoreleasePool.h>
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSString *val1, *val2, *val3;
NSMapTable *obj, *old;
id vals[3];
val1 = @"Hello";
val2 = @"Goodbye";
val3 = @"Testing";
vals[0] = val1;
vals[1] = val2;
vals[2] = val3;
obj = [[NSMapTable new] autorelease];
PASS(obj != nil
&& [obj isKindOfClass:[NSMapTable class]]
&& [obj count] == 0,
"+new creates an empty hash table");
[obj setObject: val1 forKey: @"Key1"];
PASS([obj count] == 1, "-setObject:forKey increments count");
[obj setObject: nil forKey: @"Key2"];
PASS([obj count] == 2, "-setObject:forKey: works with nil value");
TEST_EXCEPTION([obj setObject: val1 forKey: nil];,
NSInvalidArgumentException, YES, "-setObject:forKey: raises with nil key");
[arp release]; arp = nil;
return 0;
}

View file

@ -0,0 +1,10 @@
#import <Foundation/NSAutoreleasePool.h>
#import "ObjectTesting.h"
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
[arp release]; arp = nil;
return 0;
}