libs-base/Tests/base/NSProxy/basic.m
rfm 3fba03ba55 Important change to the START_SET and END_SET macros to stop their use
being confusing.  They now both take a simple C-string argument which
names the set, and the macros check that each end matches a start of
the same name.  Since tis means that a START_SET no longer takes an
argument sayng whether or notthe set is to be skipped, we now have a
SKIP macro to be used inside a set to skip to the end of it.  This
is actually more versatile as we can have multiple SKIP macros in the
same set, each providing a different reason for the set being skipped.
Also removed a few obsolete/unused functions and macros.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32355 72102866-910b-0410-8b05-ffd578937521
2011-02-24 16:26:01 +00:00

36 lines
1.2 KiB
Objective-C

#import "ObjectTesting.h"
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSProxy.h>
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
char *prefix = "Class 'NSProxy'";
Class theClass = Nil;
id obj0;
id obj1;
NSZone *testZone = NSCreateZone(1024,1024,1);
theClass = [NSProxy class];
PASS(theClass != Nil, "%s exists",prefix);
obj0 = [NSProxy alloc];
PASS(obj0 != nil, "%s has working alloc",prefix);
PASS_EXCEPTION([obj0 isKindOfClass:theClass];, NSInvalidArgumentException,
"NSProxy -isKindOfClass raises exception");
PASS_EXCEPTION([obj0 isMemberOfClass:theClass];,
NSInvalidArgumentException,
"NSProxy -isKindOfClass raises exception");
obj1 = [NSProxy allocWithZone:testZone];
PASS(obj1 != nil, "%s has working allocWithZone:",prefix);
PASS(NSZoneFromPointer(obj1) == testZone, "%s uses zone for alloc",prefix);
PASS([obj1 zone] == testZone, "%s -zone works",prefix);
PASS([obj1 hash] != 0, "%s has working -hash",prefix);
PASS([obj1 isEqual:obj1] == YES, "%s has working -isEqual:",prefix);
PASS([obj1 class] == theClass, "%s has working -class",prefix);
[arp release]; arp = nil;
return 0;
}