Author: Armin Rigo <[email protected]>
Branch:
Changeset: r1265:110b6b1931df
Date: 2013-06-01 13:07 +0200
http://bitbucket.org/cffi/cffi/changeset/110b6b1931df/
Log: Fix this test for MSVC
diff --git a/testing/test_ffi_backend.py b/testing/test_ffi_backend.py
--- a/testing/test_ffi_backend.py
+++ b/testing/test_ffi_backend.py
@@ -40,6 +40,9 @@
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")
@@ -67,8 +70,13 @@
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
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit