def pytest_runtest_setup(item): if cpu not in ('x86', 'x86_64'): py.test.skip("x86/x86_64 tests skipped: cpu is %r" % (cpu,)) if cpu == 'x86_64': if os.name == "nt": py.test.skip("Windows cannot allocate non-reserved memory") from pypy.rpython.lltypesystem import ll2ctypes ll2ctypes.do_allocation_in_far_regions()
def pytest_runtest_setup(item): if cpu not in ('x86', 'x86_64'): py.test.skip("x86/x86_64 tests skipped: cpu is %r" % (cpu, )) if cpu == 'x86_64': from pypy.rpython.lltypesystem import ll2ctypes ll2ctypes.do_allocation_in_far_regions()
def pytest_runtest_setup(item): if cpu not in ('x86', 'x86_64'): py.test.skip("x86/x86_64 tests skipped: cpu is %r" % (cpu,)) if cpu == 'x86_64': from pypy.rpython.lltypesystem import ll2ctypes ll2ctypes.do_allocation_in_far_regions()
from pypy.rpython.lltypesystem.ll2ctypes import standard_c_lib from pypy.rpython.lltypesystem.ll2ctypes import uninitialized2ctypes from pypy.rpython.lltypesystem.ll2ctypes import ALLOCATED, force_cast from pypy.rpython.lltypesystem.ll2ctypes import cast_adr_to_int, get_ctypes_type from pypy.rpython.annlowlevel import llhelper from pypy.rlib import rposix from pypy.translator.tool.cbuild import ExternalCompilationInfo from pypy.tool.udir import udir from pypy.rpython.test.test_llinterp import interpret from pypy.annotation.annrpython import RPythonAnnotator from pypy.rpython.rtyper import RPythonTyper if False: # for now, please keep it False by default from pypy.rpython.lltypesystem import ll2ctypes ll2ctypes.do_allocation_in_far_regions() class TestLL2Ctypes(object): def setup_method(self, meth): ALLOCATED.clear() def test_primitive(self): assert lltype2ctypes(5) == 5 assert lltype2ctypes('?') == ord('?') assert lltype2ctypes('\xE0') == 0xE0 assert lltype2ctypes(unichr(1234)) == 1234 assert ctypes2lltype(lltype.Signed, 5) == 5 assert ctypes2lltype(lltype.Char, ord('a')) == 'a' assert ctypes2lltype(lltype.UniChar, ord(u'x')) == u'x'