]> git.saurik.com Git - apple/objc4.git/blobdiff - test/imageorder.m
objc4-437.tar.gz
[apple/objc4.git] / test / imageorder.m
diff --git a/test/imageorder.m b/test/imageorder.m
new file mode 100644 (file)
index 0000000..8ae12aa
--- /dev/null
@@ -0,0 +1,32 @@
+#include "test.h"
+#include "imageorder.h"
+#include <objc/runtime.h>
+#include <dlfcn.h>
+
+int main()
+{
+    // +load methods and C static initializers
+    testassert(state == 3);
+    testassert(cstate == 3);
+
+    Class cls = objc_getClass("Super");
+    testassert(cls);
+
+    // make sure all categories arrived
+    state = -1;
+    [Super method0];
+    testassert(state == 0);
+    [Super method1];
+    testassert(state == 1);
+    [Super method2];
+    testassert(state == 2);
+    [Super method3];
+    testassert(state == 3);
+
+    // make sure imageorder3.out is the last category to attach
+    state = 0;
+    [Super method];
+    testassert(state == 3);
+
+    succeed(__FILE__);
+}