From e1440248bc01a4fec421f05f29659baf9f066f34 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 8 Feb 2013 08:44:37 +0100 Subject: [PATCH] add disabled test case --- tests/run/cdef_function_kwargs.pyx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/run/cdef_function_kwargs.pyx b/tests/run/cdef_function_kwargs.pyx index b45cd8b..493e64f 100644 --- a/tests/run/cdef_function_kwargs.pyx +++ b/tests/run/cdef_function_kwargs.pyx @@ -180,3 +180,24 @@ def cdef_funcptr(): cfunc_ptr(1, b=2) cfunc_ptr(a=1, b=2) cfunc_ptr(b=2, a=1) + + +''' +# This works but currently brings up C compiler warnings +# because the format string is not a literal C string. + +from libc.stdio cimport snprintf + +@cython.test_fail_if_path_exists('//GeneralCallNode') +@cython.test_assert_path_exists('//SimpleCallNode') +def varargs(): + """ + >>> print(varargs()) + abc + """ + cdef char buffer[10] + retval = snprintf(buffer, template="abc", size=10) + if retval < 0: + raise MemoryError() + return buffer[:retval].decode('ascii') +''' -- 2.7.4