| 1 |
/* Contributed by Nicola Pero <[email protected]>, December 2010. */ |
| 2 |
|
| 3 |
#include <stdio.h> |
| 4 |
#include <stdlib.h> |
| 5 |
#include <objc/objc.h> |
| 6 |
|
| 7 |
#include "load-category-2.h" |
| 8 |
|
| 9 |
/* Compile the categories in random order to prevent the runtime from |
| 10 |
sending +load in the correct order just because the classes happen |
| 11 |
to have been compiled in that order. */ |
| 12 |
@implementation TestClass2 (Category) |
| 13 |
+ load |
| 14 |
{ |
| 15 |
printf ("[TestClass2(Category) +load]\n"); |
| 16 |
|
| 17 |
/* Check that the corresponding class's +load was done. */ |
| 18 |
check_that_load_step_was_completed (1); |
| 19 |
|
| 20 |
complete_load_step (4); |
| 21 |
} |
| 22 |
@end |
| 23 |
|
| 24 |
@implementation TestClass3 (Category) |
| 25 |
+ load |
| 26 |
{ |
| 27 |
printf ("[TestClass3(Category) +load]\n"); |
| 28 |
|
| 29 |
/* Check that the corresponding class's +load was done. */ |
| 30 |
check_that_load_step_was_completed (2); |
| 31 |
|
| 32 |
complete_load_step (5); |
| 33 |
} |
| 34 |
@end |
| 35 |
|
| 36 |
@implementation TestClass1 (Category) |
| 37 |
+ load |
| 38 |
{ |
| 39 |
printf ("[TestClass1(Category) +load]\n"); |
| 40 |
|
| 41 |
/* Check that the corresponding class's +load was done. */ |
| 42 |
check_that_load_step_was_completed (0); |
| 43 |
|
| 44 |
complete_load_step (3); |
| 45 |
} |
| 46 |
@end |