Example #1
0
def test_enum():
    from re_python_pysrc import ffi
    assert ffi.integer_const("BB") == 1
    e = ffi.cast("enum foo_e", 2)
    assert ffi.string(e) == "CC"
Example #2
0
def test_global_const_nonint():
    from re_python_pysrc import ffi
    lib = ffi.dlopen(extmod)
    assert ffi.string(lib.globalconsthello, 8) == b"hello"
    py.test.raises(AttributeError, ffi.addressof, lib, 'globalconsthello')
Example #3
0
 def test_global_const_nonint(self):
     self.fix_path()
     from re_python_pysrc import ffi
     lib = ffi.dlopen(self.extmod)
     assert ffi.string(lib.globalconsthello, 8) == "hello"
     raises(AttributeError, ffi.addressof, lib, 'globalconsthello')