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 a class methods */
15 @implementation RootClass
16 #ifdef __NEXT_RUNTIME__
17 + initialize { return self; }
21 static int class_variable = 0;
23 @interface SubClass : RootClass
24 + (void) setState: (int)number;
28 @implementation SubClass
29 + (void) setState: (int)number
31 class_variable = number;
35 return class_variable;
39 #include "class-tests-1.h"
40 #define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD Class
41 #include "class-tests-2.h"
47 test_class_with_superclass ("SubClass", "RootClass");
48 test_that_class_has_class_method ("SubClass", @selector (setState:));
49 test_that_class_has_class_method ("SubClass", @selector (state));
51 class = objc_lookup_class ("SubClass");
52 test_accessor_method (class, 0, -1, -1, 1, 1);