libs-base/Testing/test02.m
Richard Frith-MacDonald 352581a203 Put autorelease pools in place
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3019 72102866-910b-0410-8b05-ffd578937521
1998-10-03 05:11:05 +00:00

41 lines
1 KiB
Objective-C

#include <gnustep/base/all.h>
#include <Foundation/NSAutoreleasePool.h>
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
id dict = [Dictionary new];
id translator = [Dictionary new];
id mc;
[dict putObject:@"herd" atKey:@"cow"];
[dict putObject:@"pack" atKey:@"dog"];
[dict putObject:@"school" atKey:@"fish"];
[dict putObject:@"flock" atKey:@"bird"];
[dict putObject:@"pride" atKey:@"cat"];
[dict putObject:@"gaggle" atKey:@"goose"];
[dict printForDebugger];
printf("removing goose\n");
[dict removeObjectAtKey:@"goose"];
[dict printForDebugger];
[translator putObject:@"cow" atKey:@"vache"];
[translator putObject:@"dog" atKey:@"chien"];
[translator putObject:@"fish" atKey:@"poisson"];
[translator putObject:@"bird" atKey:@"oisseau"];
[translator putObject:@"cat" atKey:@"chat"];
mc = [[MappedCollector alloc] initWithCollection:dict map:translator];
[mc printForDebugger];
[mc release];
[dict release];
[translator release];
[arp release];
exit(0);
}