import source from 1.3.40
[external/swig.git] / Examples / test-suite / csharp / overload_complicated_runme.cs
1 using System;
2 using overload_complicatedNamespace;
3
4 public class runme
5 {
6     static void Main() 
7     {
8       SWIGTYPE_p_int pInt = null;
9
10       // Check the correct constructors are available
11       Pop p = new Pop(pInt);
12
13       p = new Pop(pInt, false);
14
15       // Check overloaded in const only and pointers/references which target languages cannot disambiguate
16       if (p.hip(false) != 701)
17         throw new Exception("Test 1 failed");
18
19       if (p.hip(pInt) != 702)
20         throw new Exception("Test 2 failed");
21
22       // Reverse the order for the above
23       if (p.hop(pInt) != 805)
24         throw new Exception("Test 3 failed");
25
26       if (p.hop(false) != 801)
27         throw new Exception("Test 4 failed");
28
29       // Few more variations and order shuffled
30       if (p.pop(false) != 901)
31         throw new Exception("Test 5 failed");
32
33       if (p.pop(pInt) != 902)
34         throw new Exception("Test 6 failed");
35
36       if (p.pop() != 905)
37         throw new Exception("Test 7 failed");
38
39       // Overload on const only
40       if (p.bop(pInt) != 1001)
41         throw new Exception("Test 8 failed");
42
43       if (p.bip(pInt) != 2001)
44         throw new Exception("Test 9 failed");
45
46       // Globals
47       if (overload_complicated.muzak(false) != 3001)
48         throw new Exception("Test 10 failed");
49
50       if (overload_complicated.muzak(pInt) != 3002)
51         throw new Exception("Test 11 failed");
52     }
53 }
54
55