From 07159942ee0c873c938826b3d100365a0711896c Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 6 Jun 2008 19:09:20 +0200 Subject: [PATCH] test case cleanup, removes some gcc warnings --HG-- rename : tests/compile/varargdecl.pyx => tests/run/varargdecl.pyx --- tests/compile/extcoerce.pyx | 2 +- tests/compile/varargdecl.pyx | 2 -- tests/compile/while.pyx | 4 ++-- tests/compile/withgil.pyx | 3 +++ tests/run/modop.pyx | 10 ++++++---- tests/run/varargdecl.pyx | 10 ++++++++++ 6 files changed, 22 insertions(+), 9 deletions(-) delete mode 100644 tests/compile/varargdecl.pyx create mode 100644 tests/run/varargdecl.pyx diff --git a/tests/compile/extcoerce.pyx b/tests/compile/extcoerce.pyx index 613ead8a..374238e0 100644 --- a/tests/compile/extcoerce.pyx +++ b/tests/compile/extcoerce.pyx @@ -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 index 2f627265..00000000 --- a/tests/compile/varargdecl.pyx +++ /dev/null @@ -1,2 +0,0 @@ -cdef grail(char *blarg, ...): - pass diff --git a/tests/compile/while.pyx b/tests/compile/while.pyx index 31e36bc1..8d6990d3 100644 --- a/tests/compile/while.pyx +++ b/tests/compile/while.pyx @@ -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 + diff --git a/tests/compile/withgil.pyx b/tests/compile/withgil.pyx index 7d5d5484..fa77d6ed 100644 --- a/tests/compile/withgil.pyx +++ b/tests/compile/withgil.pyx @@ -3,3 +3,6 @@ cdef void f() with gil: cdef int g(void* x) with gil: pass + +f() +g("test") diff --git a/tests/run/modop.pyx b/tests/run/modop.pyx index 60d49353..be55648d 100644 --- a/tests/run/modop.pyx +++ b/tests/run/modop.pyx @@ -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 index 00000000..c59a0d16 --- /dev/null +++ b/tests/run/varargdecl.pyx @@ -0,0 +1,10 @@ +__doc__ = u""" +>>> test() +""" + +cdef grail(char *blarg, ...): + pass + +def test(): + grail("test") + grail("test", "toast") -- 2.26.2