[pypy-commit] cffi default: Test

arigo noreply at buildbot.pypy.org
Mon Jun 25 17:07:35 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r510:7702269d8ee8
Date: 2012-06-25 17:01 +0200
http://bitbucket.org/cffi/cffi/changeset/7702269d8ee8/

Log:	Test

diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -555,6 +555,13 @@
     assert s.a1 == 123
     assert s.a2 == 456
     assert s.a3 == 0
+    #
+    s = newp(BStructPtr, {'a2': 41122, 'a3': -123})
+    assert s.a1 == 0
+    assert s.a2 == 41122
+    assert s.a3 == -123
+    #
+    py.test.raises(KeyError, newp, BStructPtr, {'foobar': 0})
 
 def test_array_in_struct():
     BInt = new_primitive_type("int")


More information about the pypy-commit mailing list