]> git.saurik.com Git - apple/objc4.git/blobdiff - test/imageorder1.m
objc4-437.tar.gz
[apple/objc4.git] / test / imageorder1.m
diff --git a/test/imageorder1.m b/test/imageorder1.m
new file mode 100644 (file)
index 0000000..98ba1a4
--- /dev/null
@@ -0,0 +1,41 @@
+#include "test.h"
+#include "imageorder.h"
+
+int state = -1;
+int cstate = 0;
+
+static void c1(void) __attribute__((constructor));
+static void c1(void)
+{
+    testassert(state == 1);  // +load before C/C++
+    testassert(cstate == 0);
+    cstate = 1;
+}
+
+@implementation Super (cat1)
++(void) method {
+    fail("+[Super(cat1) method] not replaced!");
+}
++(void) method1 {
+    state = 1;
+}
++(void) load {
+    testassert(state == 0);
+    state = 1;
+}
+@end
+
+@implementation Super
++(void) initialize { }
++(void) method {
+    fail("+[Super method] not replaced!");
+}
++(void) method0 {
+    state = 0;
+}
++(void) load {
+    testassert(state == -1);
+    state = 0;
+}
+@end
+