From eeebdf1847f828a2e6557a4786b4be67bdafe1f5 Mon Sep 17 00:00:00 2001 From: Armin Rigo Date: Fri, 1 Jun 2012 17:27:24 +0200 Subject: Extent the API to allow None to variadic funcs. It is somehow a simplification because some operations on pointers will return None to mean "the C NULL". Passing them to variadic functions as None makes sense. --- testing/test_function.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'testing/test_function.py') diff --git a/testing/test_function.py b/testing/test_function.py index b11ae70..538c163 100644 --- a/testing/test_function.py +++ b/testing/test_function.py @@ -105,12 +105,14 @@ class TestFunction(object): ffi.cast("int", 42), ffi.cast("long", 84), ffi.cast("long long", 168)) + ffi.C.printf("hello %p\n", None) ffi.C.fflush(None) res = fd.getvalue() assert res == ("hello\n" "hello, world!\n" "hello, world2!\n" - "hello int 42 long 84 long long 168\n") + "hello int 42 long 84 long long 168\n" + "hello (nil)\n") def test_must_specify_type_of_vararg(self): ffi = FFI(backend=self.Backend()) -- cgit v1.2.1