test case cleanup, removes some gcc warnings
authorStefan Behnel <scoder@users.berlios.de>
Fri, 6 Jun 2008 17:09:20 +0000 (19:09 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 6 Jun 2008 17:09:20 +0000 (19:09 +0200)
--HG--
rename : tests/compile/varargdecl.pyx => tests/run/varargdecl.pyx

tests/compile/extcoerce.pyx
tests/compile/varargdecl.pyx [deleted file]
tests/compile/while.pyx
tests/compile/withgil.pyx
tests/run/modop.pyx
tests/run/varargdecl.pyx [new file with mode: 0644]

index 613ead8a752e54ca41f729134b0d2ef169c1507a..374238e08f584b55047aede6f01a186a54317dd1 100644 (file)
@@ -7,7 +7,7 @@ cdef class Swallow:
     pass
     
 def f(Grail g):
-    cdef int i
+    cdef int i = 0
     cdef Swallow s
     g = x
     x = g
diff --git a/tests/compile/varargdecl.pyx b/tests/compile/varargdecl.pyx
deleted file mode 100644 (file)
index 2f62726..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-cdef grail(char *blarg, ...):
-    pass
index 31e36bc15b822bad6edb69946180156fdd5da5ea..8d6990d3af81dbdbc800b0d80c7c1c1ac5cd3dfc 100644 (file)
@@ -1,5 +1,5 @@
 def f(a, b):
-    cdef int i
+    cdef int i = 5
     
     while a:
         x = 1
@@ -23,4 +23,4 @@ def f(a, b):
         x = 1
         continue
         x = 2
-    
\ No newline at end of file
+    
index 7d5d54846d126577a4f1a9dc59a64a72784eccfe..fa77d6ed1b6c4aa7acdbb429e033f997d0d4c2c6 100644 (file)
@@ -3,3 +3,6 @@ cdef void f() with gil:
 
 cdef int g(void* x) with gil:
     pass
+
+f()
+g("test")
index 60d493534421b7af4217d8f010ad58fff989b94f..be55648dd5a4cba89f93b53eb84558e06589931f 100644 (file)
@@ -6,6 +6,9 @@ __doc__ = u"""
 
     >>> modint(9,2)
     1
+
+    >>> print modptr()
+    spameggs
 """
 
 def modobj(obj2, obj3):
@@ -17,11 +20,10 @@ def modint(int int2, int int3):
     int1 = int2 % int3
     return int1
 
-cdef modptr():
-    # FIXME!!!
+def modptr():
     cdef char *str2, *str3
-    str2 = "spam"
+    str2 = "spam%s"
     str3 = "eggs"
 
     obj1 = str2 % str3
-    return obj1
+    return obj1.decode(u"ASCII")
diff --git a/tests/run/varargdecl.pyx b/tests/run/varargdecl.pyx
new file mode 100644 (file)
index 0000000..c59a0d1
--- /dev/null
@@ -0,0 +1,10 @@
+__doc__ = u"""
+>>> test()
+"""
+
+cdef grail(char *blarg, ...):
+    pass
+
+def test():
+    grail("test")
+    grail("test", "toast")