PageRenderTime 28ms CodeModel.GetById 20ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Java | 35 lines | 25 code | 9 blank | 1 comment | 5 complexity | 67f7b4760131c7537d758eaa4d5ae436 MD5 | raw file
 1// varargs test
 2
 3import varargs.*;
 4
 5public class varargs_runme {
 6
 7  static {
 8    try {
 9	System.loadLibrary("varargs");
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    if (!varargs.test("Hello").equals("Hello"))
19      throw new RuntimeException("Failed");
20
21    Foo f = new Foo("BuonGiorno", 1);
22    if (!f.getStr().equals("BuonGiorno"))
23      throw new RuntimeException("Failed");
24
25    f = new Foo("Greetings");
26    if (!f.getStr().equals("Greetings"))
27      throw new RuntimeException("Failed");
28        
29    if (!f.test("Hello").equals("Hello"))
30      throw new RuntimeException("Failed");
31
32    if (!Foo.statictest("Grussen", 1).equals("Grussen"))
33      throw new RuntimeException("Failed");
34  }
35}