Upstream version 1.3.40
[profile/ivi/swig.git] / Examples / test-suite / java / special_variable_macros_runme.java
1
2 import special_variable_macros.*;
3
4 public class special_variable_macros_runme {
5
6   static {
7     try {
8         System.loadLibrary("special_variable_macros");
9     } catch (UnsatisfiedLinkError e) {
10       System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
11       System.exit(1);
12     }
13   }
14
15   public static void main(String argv[]) {
16     Name name = new Name();
17     if (!special_variable_macros.testFred(name).equals("none"))
18       throw new RuntimeException("test failed");
19     if (!special_variable_macros.testJack(name).equals("$specialname"))
20       throw new RuntimeException("test failed");
21     if (!special_variable_macros.testJill(name).equals("jilly"))
22       throw new RuntimeException("test failed");
23     if (!special_variable_macros.testMary(name).equals("SWIGTYPE_p_NameWrap"))
24       throw new RuntimeException("test failed");
25     if (!special_variable_macros.testJim(name).equals("multiname num"))
26       throw new RuntimeException("test failed");
27     if (special_variable_macros.testJohn(new PairIntBool(10, false)) != 123)
28       throw new RuntimeException("test failed");
29     NewName newName = NewName.factory("factoryname");
30     name = newName.getStoredName();
31   }
32 }