[pypy-svn] r46923 - pypy/dist/pypy/module/struct/test

arigo at codespeak.net arigo at codespeak.net
Thu Sep 27 09:55:26 CEST 2007


Author: arigo
Date: Thu Sep 27 09:55:26 2007
New Revision: 46923

Modified:
   pypy/dist/pypy/module/struct/test/test_struct.py
Log:
An extra test.


Modified: pypy/dist/pypy/module/struct/test/test_struct.py
==============================================================================
--- pypy/dist/pypy/module/struct/test/test_struct.py	(original)
+++ pypy/dist/pypy/module/struct/test/test_struct.py	Thu Sep 27 09:55:26 2007
@@ -99,6 +99,10 @@
         assert calcsize('bi') == calcsize('ii') == 2 * calcsize('i')
         assert calcsize('bbi') == calcsize('ii') == 2 * calcsize('i')
         assert calcsize('hi') == calcsize('ii') == 2 * calcsize('i')
+        # CPython adds no padding at the end, unlike a C compiler
+        assert calcsize('ib') == calcsize('i') + calcsize('b')
+        assert calcsize('ibb') == calcsize('i') + 2 * calcsize('b')
+        assert calcsize('ih') == calcsize('i') + calcsize('h')
 
 
     def test_pack_native(self):



More information about the Pypy-commit mailing list