diff options
Diffstat (limited to 'Examples/test-suite/java/template_function_parm_runme.java')
-rw-r--r-- | Examples/test-suite/java/template_function_parm_runme.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Examples/test-suite/java/template_function_parm_runme.java b/Examples/test-suite/java/template_function_parm_runme.java new file mode 100644 index 000000000..3c8f3d1a9 --- /dev/null +++ b/Examples/test-suite/java/template_function_parm_runme.java @@ -0,0 +1,25 @@ +import template_function_parm.*; + +public class template_function_parm_runme { + + static { + try { + System.loadLibrary("template_function_parm"); + } catch (UnsatisfiedLinkError e) { + 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); + System.exit(1); + } + } + + public static void main(String argv[]) { + VectorInt vi = new VectorInt(); + vi.add(10); + vi.add(20); + vi.add(30); + + MyC myc = new MyC(); + int sum = myc.take_function(template_function_parmConstants.accumulate_integers, vi); + if (sum != 60) + throw new RuntimeException("Expected sum of 60, got " + sum); + } +} |