Commits

Armin Rigo  committed 3c66c29

Ignore mismatches between two different primitive types of the same size,
like on some platforms "double" and "long double".

  • Participants
  • Parent commits be070b8

Comments (0)

Files changed (1)

File testing/test_verify.py

 
 def _check_field_match(typename, real, expect_mismatch):
     ffi = FFI()
-    if expect_mismatch == 'by_size':
+    testing_by_size = (expect_mismatch == 'by_size')
+    if testing_by_size:
         expect_mismatch = ffi.sizeof(typename) != ffi.sizeof(real)
     ffi.cdef("struct foo_s { %s x; ...; };" % typename)
     try:
         ffi.verify("struct foo_s { %s x; };" % real)
     except VerificationError:
         if not expect_mismatch:
+            if testing_by_size:
+                print("ignoring mismatch between %s* and %s* even though "
+                      "they have the same size" % (typename, real))
+                return
             raise AssertionError("unexpected mismatch: %s should be accepted "
                                  "as equal to %s" % (typename, real))
     else: