1 /* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
3 #include <objc/objc-api.h>
5 #include "next_mapping.h"
7 /* Tests creating a root class and a subclass with an ivar and
8 accessor methods; accessor methods implemented in a separate
17 @implementation RootClass
18 #ifdef __NEXT_RUNTIME__
19 + initialize { return self; }
23 @interface SubClass : RootClass
29 @implementation SubClass
32 @interface SubClass (Additions)
33 - (void) setState: (int)number;
37 @implementation SubClass (Additions)
38 - (void) setState: (int)number
48 #include "class-tests-1.h"
49 #define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD SubClass *
50 #include "class-tests-2.h"
56 test_class_with_superclass ("SubClass", "RootClass");
58 /* The NeXT runtime's category implementation is lazy: categories are not attached
59 to classes until the class is initialized (at +initialize time). */
60 #ifdef __NEXT_RUNTIME__
61 [SubClass initialize];
64 test_that_class_has_instance_method ("SubClass", @selector (setState:));
65 test_that_class_has_instance_method ("SubClass", @selector (state));
67 object = class_create_instance (objc_lookup_class ("SubClass"));
68 test_accessor_method (object, 0, 1, 1, -3, -3);