Armin Rigo avatar Armin Rigo committed ec61ea5

Test and fix: a remaining deadlock

Comments (0)

Files changed (2)

cffi/vengine_gen.py

             negative = function(p)
             value = int(p[0])
             if value < 0 and not negative:
-                value += (1 << (8*self.ffi.sizeof("long long")))
+                BLongLong = self.ffi._typeof_locked("long long")[0]
+                value += (1 << (8*self.ffi.sizeof(BLongLong)))
         else:
             BFunc = self.ffi._typeof_locked(tp.get_c_name('(*)(void)', name))[0]
             function = module.load_function(BFunc, funcname)

testing/test_verify.py

 def test_define_int():
     ffi = FFI()
     ffi.cdef("#define FOO ...\n"
-             "\t#\tdefine\tBAR\t...\t")
+             "\t#\tdefine\tBAR\t...\t\n"
+             "#define BAZ ...\n")
     lib = ffi.verify("#define FOO 42\n"
-                     "#define BAR (-44)\n")
+                     "#define BAR (-44)\n"
+                     "#define BAZ 0xffffffffffffffffLL\n")
     assert lib.FOO == 42
     assert lib.BAR == -44
+    assert lib.BAZ == 0xffffffffffffffff
 
 def test_access_variable():
     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.