Debian Codegraph @

rpython/rtyper/tool/test/test_rfficache.py

raw symbols SCIP
1
2 from rpython.rtyper.tool.rfficache import *
3 from rpython.rtyper.lltypesystem import rffi
4 from rpython.tool.udir import udir
5
6 def test_sizeof_c_type():
7 sizeofchar = sizeof_c_type('char')
8 assert sizeofchar == 1
9
10 def test_types_present():
11 for name in rffi.TYPES:
12 if name.startswith('unsigned'):
13 name = 'u' + name[9:]
14 name = name.replace(' ', '')
15 assert hasattr(rffi, 'r_' + name)
16 assert hasattr(rffi, name.upper())
17
18 def test_signof_c_type():
19 assert signof_c_type('signed char') == True
20 assert signof_c_type('unsigned char') == False
21 assert signof_c_type('long long') == True
22 assert signof_c_type('unsigned long long') == False
23 #
24 assert (sizeof_c_type('wchar_t'), signof_c_type('wchar_t')) in [
25 (2, False),
26 (4, False),
27 (4, True)]