PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

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

#
Java | 32 lines | 28 code | 4 blank | 0 comment | 2 complexity | 93265aee3b0869a56af1dcf4b9b5ec63 MD5 | raw file
 1
 2import using_pointers.*;
 3
 4public class using_pointers_runme {
 5
 6  static {
 7    try {
 8        System.loadLibrary("using_pointers");
 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  {
17    FooBar f = new FooBar();
18    boolean pass = true;
19    try {
20      f.exception_spec(1);
21      pass = false;
22    } catch (RuntimeException e) {
23    }
24    if (!pass) throw new RuntimeException("Missed exception 1");
25    try {
26      f.exception_spec(2);
27      pass = false;
28    } catch (RuntimeException e) {
29    }
30    if (!pass) throw new RuntimeException("Missed exception 2");
31  }
32}