1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
3 /* This test is identical to load-category-2, but the classes and
4 categories are created in inverted order in the modules, to test
5 that you can load classes first, or categories first, and it all
10 #include <objc/objc.h>
12 #include "load-category-3.h"
14 @implementation TestClass2
17 printf ("[TestClass2 +load]\n");
18 /* Check superclasses/subclasses +load order. */
19 check_that_load_step_was_completed (0);
20 check_that_load_step_was_not_completed (1);
21 check_that_load_step_was_not_completed (2);
23 /* Check that the corresponding category's +load was not done. */
24 check_that_load_step_was_not_completed (4);
26 complete_load_step (1);
30 @implementation TestClass3
33 printf ("[TestClass3 +load]\n");
35 /* Check superclasses/subclasses +load order. */
36 check_that_load_step_was_completed (0);
37 check_that_load_step_was_completed (1);
38 check_that_load_step_was_not_completed (2);
40 /* Check that the corresponding category's +load was not done. */
41 check_that_load_step_was_not_completed (5);
43 complete_load_step (2);
47 @implementation TestClass1
48 + initialize { return self; }
51 printf ("[TestClass1 +load]\n");
53 /* Check superclasses/subclasses +load order. */
54 check_that_load_step_was_not_completed (0);
55 check_that_load_step_was_not_completed (1);
56 check_that_load_step_was_not_completed (2);
58 /* Check that the corresponding category's +load was not done. */
59 check_that_load_step_was_not_completed (3);
61 complete_load_step (0);