Testcases for #303
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Wed, 6 May 2009 18:46:36 +0000 (20:46 +0200)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Wed, 6 May 2009 18:46:36 +0000 (20:46 +0200)
tests/run/external_defs.h [new file with mode: 0644]
tests/run/typedfieldbug_T303.pyx [new file with mode: 0644]

diff --git a/tests/run/external_defs.h b/tests/run/external_defs.h
new file mode 100644 (file)
index 0000000..a6f22cf
--- /dev/null
@@ -0,0 +1,3 @@
+
+
+typedef double DoubleTypedef;
diff --git a/tests/run/typedfieldbug_T303.pyx b/tests/run/typedfieldbug_T303.pyx
new file mode 100644 (file)
index 0000000..5db6586
--- /dev/null
@@ -0,0 +1,20 @@
+"""
+>>> f()
+42.0 42.0
+"""
+
+cdef extern from "external_defs.h":
+    ctypedef float DoubleTypedef
+
+cdef class MyClass:
+    cdef readonly:
+        double var_d
+        DoubleTypedef var_nf
+    def __init__(self):
+        self.var_d = 42.0
+        self.var_nf = 42.0
+
+def f():
+    c = MyClass()
+    print c.var_d, c.var_nf
+