PageRenderTime 26ms CodeModel.GetById 9ms app.highlight 12ms RepoModel.GetById 2ms app.codeStats 0ms

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

#
Java | 49 lines | 42 code | 7 blank | 0 comment | 20 complexity | 5ec602239ed8a126d379d21e1dc86071 MD5 | raw file
 1
 2
 3import li_boost_shared_ptr_template.*;
 4
 5public class li_boost_shared_ptr_template_runme {
 6
 7  static {
 8    try {
 9	System.loadLibrary("li_boost_shared_ptr_template");
10    } catch (UnsatisfiedLinkError e) {
11      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);
12      System.exit(1);
13    }
14  }
15
16  public static void main(String argv[]) {
17    {
18      BaseINTEGER b = new BaseINTEGER();
19      DerivedINTEGER d = new DerivedINTEGER();
20      if (b.bar() != 1)
21        throw new RuntimeException("test 1");
22      if (d.bar() != 2)
23        throw new RuntimeException("test 2");
24      if (li_boost_shared_ptr_template.bar_getter(b) != 1)
25        throw new RuntimeException("test 3");
26      if (li_boost_shared_ptr_template.bar_getter(d) != 2)
27        throw new RuntimeException("test 4");
28    }
29
30    {
31      BaseDefaultInt b = new BaseDefaultInt();
32      DerivedDefaultInt d = new DerivedDefaultInt();
33      DerivedDefaultInt2 d2 = new DerivedDefaultInt2();
34      if (b.bar2() != 3)
35        throw new RuntimeException("test 5");
36      if (d.bar2() != 4)
37        throw new RuntimeException("test 6");
38      if (d2.bar2() != 4)
39        throw new RuntimeException("test 6");
40      if (li_boost_shared_ptr_template.bar2_getter(b) != 3)
41        throw new RuntimeException("test 7");
42      if (li_boost_shared_ptr_template.bar2_getter(d) != 4)
43        throw new RuntimeException("test 8");
44      if (li_boost_shared_ptr_template.bar2_getter(d2) != 4)
45        throw new RuntimeException("test 8");
46    }
47  }
48}
49