mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Initial revision
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
commit
0098375b73
248 changed files with 40027 additions and 0 deletions
44
Testing/test03.m
Normal file
44
Testing/test03.m
Normal file
|
@ -0,0 +1,44 @@
|
|||
|
||||
#include <objects/objects.h>
|
||||
|
||||
|
||||
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)];
|
||||
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 <Collecting> */
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue