PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/octave/reference_global_vars_runme.m

#
Objective C | 91 lines | 73 code | 18 blank | 0 comment | 33 complexity | dfbe9474314fa17da0a17fbf75696acb MD5 | raw file
 1reference_global_vars
 2
 3# const class reference variable
 4if (getconstTC().num != 33)
 5    error
 6endif
 7
 8# primitive reference variables
 9cvar.var_bool = createref_bool(false);
10if (value_bool(cvar.var_bool) != 0)
11    error
12endif
13
14cvar.var_bool = createref_bool(true);
15if (value_bool(cvar.var_bool) != 1)
16    error
17endif
18
19cvar.var_char = createref_char('w');
20if (!strcmp(value_char(cvar.var_char),'w'))
21    error
22endif
23
24cvar.var_unsigned_char = createref_unsigned_char(10);
25if (value_unsigned_char(cvar.var_unsigned_char) != 10)
26    error
27endif
28
29cvar.var_signed_char = createref_signed_char(10);
30if (value_signed_char(cvar.var_signed_char) != 10)
31    error
32endif
33
34cvar.var_short = createref_short(10);
35if (value_short(cvar.var_short) != 10)
36    error
37endif
38
39cvar.var_unsigned_short = createref_unsigned_short(10);
40if (value_unsigned_short(cvar.var_unsigned_short) != 10)
41    error
42endif
43
44cvar.var_int = createref_int(10);
45if (value_int(cvar.var_int) != 10)
46    error
47endif
48
49cvar.var_unsigned_int = createref_unsigned_int(10);
50if (value_unsigned_int(cvar.var_unsigned_int) != 10)
51    error
52endif
53
54cvar.var_long = createref_long(10);
55if (value_long(cvar.var_long) != 10)
56    error
57endif
58
59cvar.var_unsigned_long = createref_unsigned_long(10);
60if (value_unsigned_long(cvar.var_unsigned_long) != 10)
61    error
62endif
63
64cvar.var_long_long = createref_long_long(int64(0x6FFFFFFFFFFFFFF8));
65if (value_long_long(cvar.var_long_long) != int64(0x6FFFFFFFFFFFFFF8))
66    error
67endif
68
69#ull = abs(0xFFFFFFF2FFFFFFF0)
70ull = uint64(55834574864);
71cvar.var_unsigned_long_long = createref_unsigned_long_long(ull);
72if (value_unsigned_long_long(cvar.var_unsigned_long_long) != ull)
73    error
74endif
75
76cvar.var_float = createref_float(10.5);
77if (value_float(cvar.var_float) != 10.5)
78    error
79endif
80
81cvar.var_double = createref_double(10.5);
82if (value_double(cvar.var_double) != 10.5)
83    error
84endif
85
86# class reference variable
87cvar.var_TestClass = createref_TestClass(TestClass(20));
88if (value_TestClass(cvar.var_TestClass).num != 20)
89    error
90endif
91