mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Initial revision
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@291 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
baba8f65d9
commit
9a409d63ba
5 changed files with 663 additions and 0 deletions
30
Testing/nsarray.m
Normal file
30
Testing/nsarray.m
Normal file
|
@ -0,0 +1,30 @@
|
|||
#include <foundation/NSArray.h>
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
id a, b;
|
||||
|
||||
set_behavior_debug(1);
|
||||
a = [NSArray arrayWithObjects:
|
||||
[NSObject class],
|
||||
[NSArray class],
|
||||
[NSMutableArray class]];
|
||||
|
||||
printf("NSArray has count %d\n", [a count]);
|
||||
printf("Classname at index 1 is %s\n", [[a objectAtIndex:1] name]);
|
||||
|
||||
assert([a containsObject:[NSObject class]]);
|
||||
assert([a lastObject]);
|
||||
[a makeObjectsPerform:@selector(self)];
|
||||
|
||||
b = [a mutableCopy];
|
||||
assert([b count]);
|
||||
[b addObject:[NSObject class]];
|
||||
[b removeObject:[NSArray class]];
|
||||
[b removeLastObject];
|
||||
|
||||
assert([b firstObjectCommonWithArray:a]);
|
||||
|
||||
exit(0);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue