1 /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
5 /* Tests creating a root class and a subclass with an ivar and
6 accessor methods; accessor methods implemented in a separate
15 @implementation RootClass
16 + initialize { return self; }
19 @interface SubClass : RootClass
25 @implementation SubClass
28 @interface SubClass (Additions)
29 - (void) setState: (int)number;
33 @implementation SubClass (Additions)
34 - (void) setState: (int)number
44 #include "class-tests-1.h"
45 #define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD SubClass *
46 #include "class-tests-2.h"
52 test_class_with_superclass ("SubClass", "RootClass");
54 /* The NeXT runtime's category implementation is lazy: categories are not attached
55 to classes until the class is initialized (at +initialize time). */
56 #ifdef __NEXT_RUNTIME__
57 [SubClass initialize];
60 test_that_class_has_instance_method ("SubClass", @selector (setState:));
61 test_that_class_has_instance_method ("SubClass", @selector (state));
63 object = class_createInstance (objc_getClass ("SubClass"), 0);
64 test_accessor_method (object, 0, 1, 1, -3, -3);