test case for 'cdef extern class' definitions in .pxd files
authorStefan Behnel <scoder@users.berlios.de>
Wed, 9 Apr 2008 15:08:50 +0000 (17:08 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 9 Apr 2008 15:08:50 +0000 (17:08 +0200)
tests/compile/crunchytype.h [new file with mode: 0644]
tests/compile/crunchytype.pxd [new file with mode: 0644]
tests/compile/extimportedsubtype.pyx [new file with mode: 0644]

diff --git a/tests/compile/crunchytype.h b/tests/compile/crunchytype.h
new file mode 100644 (file)
index 0000000..6ea0e37
--- /dev/null
@@ -0,0 +1,5 @@
+
+struct CrunchyType {
+  int number;
+  PyObject* string;
+};
diff --git a/tests/compile/crunchytype.pxd b/tests/compile/crunchytype.pxd
new file mode 100644 (file)
index 0000000..c03e38d
--- /dev/null
@@ -0,0 +1,4 @@
+cdef extern from "crunchytype.h":
+    cdef class crunchytype.Crunchy [ object CrunchyType ]:
+        cdef int number
+        cdef object string
diff --git a/tests/compile/extimportedsubtype.pyx b/tests/compile/extimportedsubtype.pyx
new file mode 100644 (file)
index 0000000..dd081e0
--- /dev/null
@@ -0,0 +1,7 @@
+from crunchytype cimport Crunchy
+
+cdef class Sub2(Crunchy):
+    cdef char character
+
+cdef class Sub1(Sub2):
+    cdef char character