4 public class aggregate_runme {
8 System.loadLibrary("aggregate");
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);
15 public static void main(String argv[]) {
17 // Confirm that move() returns correct results under normal use
18 int result = aggregate.move(aggregate.UP);
19 if (result != aggregate.UP) throw new RuntimeException("UP failed");
21 result = aggregate.move(aggregate.DOWN);
22 if (result != aggregate.DOWN) throw new RuntimeException("DOWN failed");
24 result = aggregate.move(aggregate.LEFT);
25 if (result != aggregate.LEFT) throw new RuntimeException("LEFT failed");
27 result = aggregate.move(aggregate.RIGHT);
28 if (result != aggregate.RIGHT) throw new RuntimeException("RIGHT failed");
30 // Confirm that move() raises an exception when the contract is violated
33 throw new RuntimeException("0 test failed");
35 catch (IllegalArgumentException e) {