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

/trunk/Examples/test-suite/java/special_variable_macros_runme.java

#
Java | 32 lines | 28 code | 4 blank | 0 comment | 7 complexity | 9636ea74077424819a04d0ef11cf6d8b MD5 | raw file
 1
 2import special_variable_macros.*;
 3
 4public 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}