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

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

#
Objective C | 58 lines | 43 code | 15 blank | 0 comment | 23 complexity | 7d6650b29f7511ef07a5cac3c03171a8 MD5 | raw file
 1overload_complicated
 2
 3pInt = None;
 4
 5# Check the correct constructors are available
 6p = Pop(pInt);
 7
 8p = Pop(pInt, 0);
 9
10# Check overloaded in const only and pointers/references which target languages cannot disambiguate
11if (p.hip(0) != 701)
12  error("Test 1 failed")
13endif
14
15if (p.hip(pInt) != 702)
16  error("Test 2 failed")
17endif
18
19# Reverse the order for the above
20if (p.hop(pInt) != 805)
21  error("Test 3 failed")
22endif
23
24if (p.hop(0) != 801)
25  error("Test 4 failed")
26endif
27
28# Few more variations and order shuffled
29if (p.pop(0) != 901)
30  error("Test 5 failed")
31endif
32
33if (p.pop(pInt) != 902)
34  error("Test 6 failed")
35endif
36
37if (p.pop() != 905)
38  error("Test 7 failed")
39endif
40
41# Overload on const only
42if (p.bop(pInt) != 1001)
43  error("Test 8 failed")
44endif
45
46if (p.bip(pInt) != 2001)
47  error("Test 9 failed")
48endif
49
50# Globals
51if (muzak(0) != 3001)
52  error("Test 10 failed")
53endif
54
55if (muzak(pInt) != 3002)
56  error("Test 11 failed")
57endif
58