PageRenderTime 12ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Java | 28 lines | 22 code | 5 blank | 1 comment | 2 complexity | d8b6766ba2375560e8456da41eb86850 MD5 | raw file
 1
 2import java_prepost.*;
 3
 4public class java_prepost_runme {
 5
 6  static {
 7    try {
 8	System.loadLibrary("java_prepost");
 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    // ensure checked exception is generated
18    try {
19      PrePostThrows ppt = new PrePostThrows(null);
20    } catch (InstantiationException e) {
21    }
22  }
23
24  private static void Assert(double d1, double d2) {
25    if (d1 != d2)
26      throw new RuntimeException("assertion failure. " + d1 + " != " + d2);
27  }
28}