remove obsolete tests

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7563 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-09-20 13:50:24 +00:00
parent 9f692f7c66
commit a32e0002d9
2 changed files with 0 additions and 134 deletions

View file

@ -1,93 +0,0 @@
#include <base/all.h>
#include <Foundation/NSValue.h>
#include <base/Invocation.h>
#include <Foundation/NSAutoreleasePool.h>
@interface ConstantCollection (TestingExtras)
- printCount;
@end
@implementation ConstantCollection (TestingExtras)
- printCount
{
printf("%s: count=%d\n", object_get_class_name (self), [self count]);
return self;
}
@end
void checkSameContents(id objectslist)
{
unsigned i, c = [objectslist count];
for (i = 1; i < c; i++)
if (![[objectslist objectAtIndex:0]
contentsEqual:[objectslist objectAtIndex:i]])
printf("collection 0 does not have same contents as collection %d\n", i);
}
int main()
{
int i;
NSAutoreleasePool *arp = [NSAutoreleasePool new];
id array = [Array new];
// id bag = [Bag new];
// id set = [Set new];
id stack = [Stack new];
id queue = [Queue new];
id gaparray = [GapArray new];
id foo = [Array new];
id collections = [DelegatePool new];
[collections delegatePoolAddObject:array];
// [collections delegatePoolAddObject:bag];
// [collections delegatePoolAddObject:set];
[collections delegatePoolAddObject:stack];
[collections delegatePoolAddObject:queue];
[collections delegatePoolAddObject:gaparray];
[collections delegatePoolAddObject:foo];
printf("delegatePool filled, count=%d\n",
[[collections delegatePoolCollection] count]);
[collections addObject: [NSNumber numberWithInt: 99]];
[collections printCount];
printf("Adding numbers...\n");
for (i = 1; i < 17; i++)
{
printf("%2d ", i);
[collections addObject: [NSNumber numberWithInt: i]];
}
printf("\ncollections filled\n\n");
[collections printForDebugger];
{
id inv = [[MethodInvocation alloc]
initWithTarget: nil
selector: @selector(isEqual:),
[NSNumber numberWithInt:0]];
if ([array trueForAllObjectsByInvoking: inv])
printf("Array contains no zero's\n");
}
checkSameContents([collections delegatePoolCollection]);
printf("\nremoving 99\n\n");
[collections removeObject: [NSNumber numberWithInt: 99]];
[foo removeObject:[foo minObject]];
[foo addObject: [NSNumber numberWithInt: 99]];
printf("Collections 0 and 4 should mismatch\n");
[collections printForDebugger];
checkSameContents([collections delegatePoolCollection]);
[collections release];
[arp release];
exit(0);
}

View file

@ -1,41 +0,0 @@
#include <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);
}