Commits

Armin Rigo committed 110b6b1

Fix this test for MSVC

Comments (0)

Files changed (1)

testing/test_ffi_backend.py

 
 class TestBitfield:
     def check(self, source, expected_ofs_y, expected_align, expected_size):
+        # NOTE: 'expected_*' is the numbers expected from GCC.
+        # The numbers expected from MSVC are not explicitly written
+        # in this file, and will just be taken from the compiler.
         ffi = FFI()
         ffi.cdef("struct s1 { %s };" % source)
         ctype = ffi.typeof("struct s1")
                 return &s;
             }
         """ % (source, ' '.join(setters)))
-        assert (lib.Gofs_y, lib.Galign, lib.Gsize) == (
-            expected_ofs_y, expected_align, expected_size)
+        if sys.platform == 'win32':
+            expected_ofs_y = lib.Gofs_y
+            expected_align = lib.Galign
+            expected_size  = lib.Gsize
+        else:
+            assert (lib.Gofs_y, lib.Galign, lib.Gsize) == (
+                expected_ofs_y, expected_align, expected_size)
         # the real test follows
         assert ffi.offsetof("struct s1", "y") == expected_ofs_y
         assert ffi.alignof("struct s1") == expected_align