Commits

Armin Rigo committed 818271d

Add a test

Comments (0)

Files changed (1)

testing/test_math.py

+import py
 from ffi import FFI
 import math, os, cStringIO
 
     assert res == ("hello\n"
                    "hello, world!\n"
                    "hello int 42 long 84 long long 168\n")
+
+def test_must_specify_type_of_vararg():
+    ffi = FFI()
+    ffi.cdef("""
+       int printf(const char *format, ...);
+    """)
+    e = py.test.raises(TypeError, ffi.C.printf, "hello %d\n", 42)
+    assert str(e.value) == 'argument 2 needs to be a cdata'