From 1bb22b3bd40a1edab0d560df2a7b75675a071677 Mon Sep 17 00:00:00 2001 From: mccallum Date: Wed, 17 Apr 1996 19:10:40 +0000 Subject: [PATCH] File deleted. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1442 72102866-910b-0410-8b05-ffd578937521 --- Testing/test03.m | 52 ------------------------------- Testing/test04.m | 47 ---------------------------- Testing/test05.m | 17 ---------- Testing/test06.m | 23 -------------- Testing/test07.m | 16 ---------- Testing/test08.m | 74 ------------------------------------------- Testing/test09.m | 81 ------------------------------------------------ Testing/test10.m | 35 --------------------- Testing/test11.m | 29 ----------------- Testing/test12.m | 35 --------------------- Testing/test13.m | 45 --------------------------- 11 files changed, 454 deletions(-) delete mode 100644 Testing/test03.m delete mode 100644 Testing/test04.m delete mode 100644 Testing/test05.m delete mode 100644 Testing/test06.m delete mode 100644 Testing/test07.m delete mode 100644 Testing/test08.m delete mode 100644 Testing/test09.m delete mode 100644 Testing/test10.m delete mode 100644 Testing/test11.m delete mode 100644 Testing/test12.m delete mode 100644 Testing/test13.m diff --git a/Testing/test03.m b/Testing/test03.m deleted file mode 100644 index 27e6dafe8..000000000 --- a/Testing/test03.m +++ /dev/null @@ -1,52 +0,0 @@ - -#include - - -int main() -{ - id array = [[Array alloc] initWithType:@encode(int)]; - id bag; - id llist; - id btree; - - [array addElementsCount:6, ((elt)0),((elt)1),((elt)5),((elt)3), - ((elt)4),((elt)2)]; -#if 0 - printf("got %s\n", [Bag name]); - printf("got class %s\n", [[Bag class] name]); - printf("class archiver %d\n", (int)[[Bag class] classForArchiver]); - printf("conforms %d\n", (int)[[Bag class] - conformsToProtocol: - @protocol(KeyedCollecting)]); -#endif - bag = [array shallowCopyAs:[Bag class]]; - llist = [[EltNodeCollector alloc] initWithType:@encode(int) - nodeCollector:[[LinkedList alloc] init] - nodeClass:[LinkedListEltNode class]]; - [llist addContentsOf:array]; - - btree = [[EltNodeCollector alloc] initWithType:@encode(int) - nodeCollector:[[BinaryTree alloc] init] - nodeClass:[BinaryTreeEltNode class]]; - [btree addContentsOf:array]; - printf("btree count = %d\n", [btree count]); - - /* tmp test */ -/* - if (typeof((id)0) != typeof(id)) - printf("typeof error\n"); -*/ - - [array printForDebugger]; - [bag printForDebugger]; - [llist printForDebugger]; - [btree printForDebugger]; - - /* foo = [array shallowCopyAs:[Object class]]; - Shouldn't the compiler complain about this? - Object does not conform to */ - - exit(0); -} - - diff --git a/Testing/test04.m b/Testing/test04.m deleted file mode 100644 index 9ecbfb84f..000000000 --- a/Testing/test04.m +++ /dev/null @@ -1,47 +0,0 @@ -/* Test Heap class. */ - -#include - -#define N 20 - -#if (sun && __svr4__) || defined(__hpux) || defined(_SEQUENT_) -long lrand48(); -#define random lrand48 -#else -#if WIN32 -#define random rand -#else -long random(); -#endif -#endif - -int main() -{ - int i; - int s, s1, s2; - - Heap* heap = [Heap new]; - Array* array = [Array new]; - - for (i = 0; i < N; i++) - { - s = random (); - [heap addObject: [NSNumber numberWithInt: i]]; - [array addObject: [NSNumber numberWithInt: i]]; - } - [array sortContents]; - - for (i = 0; i < N; i++) - { - s1 = [heap removeFirstObject]; - s2 = [array removeLastObject]; - printf("(%d,%d) ", s1, s2); - assert (s1 != s2); - } - printf("\n"); - - [heap release]; - [array release]; - - exit(0); -} diff --git a/Testing/test05.m b/Testing/test05.m deleted file mode 100644 index 2232f2391..000000000 --- a/Testing/test05.m +++ /dev/null @@ -1,17 +0,0 @@ -#include - -int main() -{ - id a = [[Array alloc] initWithType:@encode(int)]; - int i; - unsigned ret42 (arglist_t f) { return 42; } - - [a addElementsCount:5, - ((elt)0),((elt)1),((elt)2),((elt)3),((elt)4)]; - [a printForDebugger]; - i = [a indexOfElement:99 - ifAbsentCall:ret42]; - - printf("This should be 42---> %d\n", i); - exit(0); -} diff --git a/Testing/test06.m b/Testing/test06.m deleted file mode 100644 index db84b496f..000000000 --- a/Testing/test06.m +++ /dev/null @@ -1,23 +0,0 @@ - -#include - -#define N 20 - -int main() -{ - int i; - - Array* array = [[Array alloc] init]; - - for (i = 0; i < N; i++) - { - [array addObject:[[[NSObject alloc] init] autorelease]]; - } - - [array makeObjectsPerform:@selector(name)]; - - [[array objectAtIndex:0] hash]; - [array release]; - printf("no errors\n"); - exit(0); -} diff --git a/Testing/test07.m b/Testing/test07.m deleted file mode 100644 index 2a7740afb..000000000 --- a/Testing/test07.m +++ /dev/null @@ -1,16 +0,0 @@ -#include - -int main() -{ - id a = [[Array alloc] initWithType:@encode(int)]; - int i; - void plus2 (elt e) {printf("%d ", e.int_u+2);} - - for (i = 0; i < 10; i++) - [a addElement:i]; - - [a withElementsCall:plus2]; - - printf("\n"); - exit(0); -} diff --git a/Testing/test08.m b/Testing/test08.m deleted file mode 100644 index 10d8e552a..000000000 --- a/Testing/test08.m +++ /dev/null @@ -1,74 +0,0 @@ - -#include -#include - -void test(id objects) -{ - Coder *coder; - id read_objects; - - [objects addElementsCount:6, ((elt)0),((elt)1),((elt)5),((elt)3), - ((elt)4),((elt)2)]; - printf("written "); - [objects printForDebugger]; - - coder = [[BinaryCoder alloc] - initEncodingOnStream: [[StdioStream alloc] - initWithFilename:"test08.data" - fmode: "w"]]; - [coder encodeObject:objects - withName:""]; - [coder release]; - [objects release]; - - coder = [[BinaryCoder alloc] - initDecodingOnStream: [[StdioStream alloc] - initWithFilename:"test08.data" - fmode: "r"]]; - [coder decodeObjectAt:&read_objects withName:NULL]; - [coder release]; - printf("read "); - [read_objects printForDebugger]; - [read_objects release]; -} - -int main() -{ - id objects; - - objects = [[Array alloc] initWithType:@encode(int)]; - test(objects); - - objects = [[Bag alloc] initWithType:@encode(int)]; - test(objects); - - objects = [[Set alloc] initWithType:@encode(int)]; - test(objects); - -#if 0 - objects = [[GapArray alloc] initWithType:@encode(int)]; - test(objects); -#endif - - objects = [[EltNodeCollector alloc] initWithType:@encode(int) - nodeCollector:[[LinkedList alloc] init] - nodeClass:[LinkedListEltNode class]]; - test(objects); - -#if 0 - objects = [[EltNodeCollector alloc] initWithType:@encode(int) - nodeCollector:[[BinaryTree alloc] init] - nodeClass:[BinaryTreeEltNode class]]; - test(objects); -#endif - -#if 0 - objects = [[EltNodeCollector alloc] initWithType:@encode(int) - nodeClass:[RBTreeEltNode class]]; - test(objects); -#endif - - exit(0); -} - - diff --git a/Testing/test09.m b/Testing/test09.m deleted file mode 100644 index 24fab6ced..000000000 --- a/Testing/test09.m +++ /dev/null @@ -1,81 +0,0 @@ -#include - -#if (sun && __svr4__) || defined(__hpux) || defined(_SEQUENT_) -long lrand48(); -#define random lrand48 -#else -long random(); -#endif - -int main() -{ - int i; - id node; - id s = [[EltNodeCollector alloc] initWithType:@encode(int) - nodeCollector:[[SplayTree alloc] init] - nodeClass:[BinaryTreeEltNode class]]; - void foo (id o) {[o self];} - - for (i = 1; i < 20; i++) - [s addElement:(int)random()%99]; - [[s contentsCollector] binaryTreePrintForDebugger]; - [s release]; - - s = [[EltNodeCollector alloc] initWithType:@encode(int) - nodeCollector:[[SplayTree alloc] init] - nodeClass:[BinaryTreeEltNode class]]; - for (i = 1; i < 20; i++) - [s addElement:(int)random()%99]; - [[s contentsCollector] binaryTreePrintForDebugger]; - [s removeElement:[s elementAtIndex:10]]; - [[s contentsCollector] binaryTreePrintForDebugger]; - [[s contentsCollector] withObjectsCall:foo]; - [s release]; - - s = [[EltNodeCollector alloc] initWithType:@encode(int) - nodeCollector:[[BinaryTree alloc] init] - nodeClass:[BinaryTreeEltNode class]]; - [s appendElement:'i']; - [s insertElement:'h' before:'i']; - [s insertElement:'g' before:'h']; - [s insertElement:'f' before:'g']; - [s insertElement:'e' after:'f']; - [s insertElement:'d' before:'e']; - [s insertElement:'c' after:'d']; - [s insertElement:'b' after:'c']; - [s insertElement:'a' after:'b']; - [[s contentsCollector] binaryTreePrintForDebugger]; - [[s contentsCollector] binaryTreePrintForDebugger]; - - s = [[EltNodeCollector alloc] initWithType:@encode(char) - nodeCollector:[[SplayTree alloc] init] - nodeClass:[BinaryTreeEltNode class]]; - [s appendElement:(char)'i']; - [s insertElement:(char)'h' before:(char)'i']; - [s insertElement:(char)'g' before:(char)'h']; - [s insertElement:(char)'f' before:(char)'g']; - [s insertElement:(char)'e' after:(char)'f']; - [s insertElement:(char)'d' before:(char)'e']; - [s insertElement:(char)'c' after:(char)'d']; - [s insertElement:(char)'b' after:(char)'c']; - [s insertElement:(char)'a' after:(char)'b']; - [[s contentsCollector] binaryTreePrintForDebugger]; - - [[s contentsCollector] splayNode:[s eltNodeWithElement:(char)'a']]; - [[s contentsCollector] binaryTreePrintForDebugger]; - -/* - while ([s eltNodeWithElement:(char)'a'] - != [[s contentsCollector] rootNode]) - { - [[s contentsCollector] _doSplayOperationOnNode: - [s eltNodeWithElement:(char)'a']]; - printf("===============================\n"); - [[s contentsCollector] binaryTreePrintForDebugger]; - } -*/ - - if ((node = [s eltNodeWithElement:(char)'z']) != nil) - [s error:"eltNodeWithElement: loses."]; - exit(0); -} diff --git a/Testing/test10.m b/Testing/test10.m deleted file mode 100644 index 8263cee9f..000000000 --- a/Testing/test10.m +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include - -int main() -{ -#if ELT_INCLUDES_DOUBLE - - id a = [[Array alloc] initWithType:@encode(double)]; - elt e; - double dbl; - - printf("testing elt doubles\n"); - - [a addElement:(double)3.14]; - [a addElement:(double)1.41]; - [a addElement:(double)4.15]; - [a addElement:(double)1.59]; - [a addElement:(double)5.92]; - [a addElement:(double)9.26]; - - e = [a elementAtIndex:1]; - dbl = [a elementAtIndex:2].double_u; - printf("dbl = %f\n", dbl); - - [a addElementIfAbsent:(double)9.26]; - assert([a count] == 6); - - [a removeElement:(double)3.14]; - assert([a count] == 5); - -#endif /* ELT_INCLUDES_DOUBLE */ - - printf("no errors\n"); - exit(0); -} diff --git a/Testing/test11.m b/Testing/test11.m deleted file mode 100644 index c07dc2dc8..000000000 --- a/Testing/test11.m +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -int -main(int argc, char *argv[]) -{ - id table; - int i, times; - - if (argc < 2) { - fprintf(stderr, "Usage: table_test filename repeat\n"); - fprintf(stderr, " filename is a stringtable format file.\n"); - fprintf(stderr, " repeat is a number of times to loop\n"); - exit(1); - } - if (argc == 3) - times = atoi(argv[2]); - else - times = 1; - - table = [[NXStringTable alloc] init]; - - for (i=0; i < times; i++) { - [table readFromFile:argv[1]]; - printf("-----------------------------------------\n"); - [table writeToStream:stdout]; - } - return 0; -} diff --git a/Testing/test12.m b/Testing/test12.m deleted file mode 100644 index f40fc8292..000000000 --- a/Testing/test12.m +++ /dev/null @@ -1,35 +0,0 @@ - -#include -#include -#include - -int main() -{ - id r; - id rng; - int i; - - r = [[Random alloc] init]; - printf("float\n"); - for (i = 0; i < 20; i++) - printf("%f\n", [r randomFloat]); - printf("doubles\n"); - for (i = 0; i < 20; i++) - printf("%f\n", [r randomDouble]); - - rng = [[RNGBerkeley alloc] init]; - printf("%s chi^2 = %f\n", - [rng name], [Random chiSquareOfRandomGenerator:rng]); - [r release]; - - rng = [[RNGAdditiveCongruential alloc] init]; -/* - for (i = 0; i < 50; i++) - printf("%ld\n", [r nextRandom]); -*/ - printf("%s chi^2 = %f\n", - [rng name], [Random chiSquareOfRandomGenerator:rng]); - [rng release]; - - exit(0); -} diff --git a/Testing/test13.m b/Testing/test13.m deleted file mode 100644 index 8dbb07dcd..000000000 --- a/Testing/test13.m +++ /dev/null @@ -1,45 +0,0 @@ -/* -From: Matthias Klose -Date: Mon, 1 Aug 1994 21:17:20 +0200 -To: mccallum@cs.rochester.edu -Subject: bug in libcoll-940725 -Reply-to: doko@cs.tu-berlin.de - -Hello, the following code core dumps on Solaris 2.3 (compiled with gcc -2.5.8 -g -O and with -g) and on NeXTstep 3.2 (gcc 2.5.8). -Any hints? -*/ - -#include - -int main () -{ - Array *a; - CircularArray *c; - Queue *q; - - a = [Array new]; - - [a prependObject: [NSObject new]]; - [a prependObject: [NSObject new]]; - [a prependObject: [NSObject new]]; - printf("count: %d\n", [a count]); - [a insertObject: [NSObject new] atIndex: 2]; // ok! - printf("count: %d\n", [a count]); - - c = [CircularArray new]; - [c prependObject: [NSNumber numberWithInt:3]]; - [c prependObject: [NSNumber numberWithInt:2]]; - [c prependObject: [NSNumber numberWithInt:1]]; - [c insertObject:[NSNumber numberWithInt:0] atIndex:2]; // core dump! - - q = [Queue new]; - [q enqueueObject: [NSObject new]]; - [q enqueueObject: [NSObject new]]; - [q enqueueObject: [NSObject new]]; - printf("count: %d\n", [q count]); - [q insertObject: [NSObject new] atIndex: 2]; // core dump! - printf("count: %d\n", [q count]); - - exit (0); -}