Armin Rigo avatar Armin Rigo committed 3d7ee2f

Fix the test for 64-bit: alignment issues

Comments (0)

Files changed (1)

testing/test_verify.py

 
 def test_struct_ptr_to_array_field():
     ffi = FFI()
-    ffi.cdef("struct foo_s { int (*a)[17]; ...; };")
-    ffi.verify("struct foo_s { int x; int (*a)[17]; int y; };")
-    assert ffi.sizeof('struct foo_s') == 2 * ffi.sizeof('int') + ffi.sizeof('int(*)[17]')
+    ffi.cdef("struct foo_s { int (*a)[17]; ...; }; struct bar_s { ...; };")
+    ffi.verify("struct foo_s { int x; int (*a)[17]; int y; };\n"
+               "struct bar_s { int x; int *a; int y; };")
+    assert ffi.sizeof('struct foo_s') == ffi.sizeof("struct bar_s")
     s = ffi.new("struct foo_s *")
-    assert ffi.sizeof(s.a) == ffi.sizeof('int(*)[17]')
+    assert ffi.sizeof(s.a) == ffi.sizeof('int(*)[17]') == ffi.sizeof("int *")
 
 def test_struct_with_bitfield_exact():
     ffi = FFI()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.