summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/reference_global_vars_runme.py
blob: 6c2d181acf91a5bdf8dd0e8d5cf27caccbe9317e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from reference_global_vars import *

# const class reference variable
if getconstTC().num != 33:
    raise RuntimeError

# primitive reference variables
cvar.var_bool = createref_bool(False)
if value_bool(cvar.var_bool) != False:
    raise RuntimeError

cvar.var_bool = createref_bool(True)
if value_bool(cvar.var_bool) != True:
    raise RuntimeError

cvar.var_char = createref_char('w')
if value_char(cvar.var_char) != 'w':
    raise RuntimeError

cvar.var_unsigned_char = createref_unsigned_char(10)
if value_unsigned_char(cvar.var_unsigned_char) != 10:
    raise RuntimeError

cvar.var_signed_char = createref_signed_char(10)
if value_signed_char(cvar.var_signed_char) != 10:
    raise RuntimeError

cvar.var_short = createref_short(10)
if value_short(cvar.var_short) != 10:
    raise RuntimeError

cvar.var_unsigned_short = createref_unsigned_short(10)
if value_unsigned_short(cvar.var_unsigned_short) != 10:
    raise RuntimeError

cvar.var_int = createref_int(10)
if value_int(cvar.var_int) != 10:
    raise RuntimeError

cvar.var_unsigned_int = createref_unsigned_int(10)
if value_unsigned_int(cvar.var_unsigned_int) != 10:
    raise RuntimeError

cvar.var_long = createref_long(10)
if value_long(cvar.var_long) != 10:
    raise RuntimeError

cvar.var_unsigned_long = createref_unsigned_long(10)
if value_unsigned_long(cvar.var_unsigned_long) != 10:
    raise RuntimeError

cvar.var_long_long = createref_long_long(0x6FFFFFFFFFFFFFF8)
if value_long_long(cvar.var_long_long) != 0x6FFFFFFFFFFFFFF8:
    raise RuntimeError

#ull = abs(0xFFFFFFF2FFFFFFF0)
ull = 55834574864
cvar.var_unsigned_long_long = createref_unsigned_long_long(ull)
if value_unsigned_long_long(cvar.var_unsigned_long_long) != ull:
    raise RuntimeError

cvar.var_float = createref_float(10.5)
if value_float(cvar.var_float) != 10.5:
    raise RuntimeError

cvar.var_double = createref_double(10.5)
if value_double(cvar.var_double) != 10.5:
    raise RuntimeError

# class reference variable
cvar.var_TestClass = createref_TestClass(TestClass(20))
if value_TestClass(cvar.var_TestClass).num != 20:
    raise RuntimeError