aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/java/cpp11_template_parameters_decltype_runme.java
diff options
context:
space:
mode:
authorAlistair Delva <adelva@google.com>2024-04-10 14:15:29 -0700
committerAlistair Delva <adelva@google.com>2024-04-11 12:58:28 -0700
commitd0f0f90be16c2ac553b5fa08512045273135147a (patch)
tree5d9ebb7a04807ea8a609ddd18b0162bc87530e4b /Examples/test-suite/java/cpp11_template_parameters_decltype_runme.java
parent6ffc1dbf29ba98c4d8aa71ebc9b484e973fe1030 (diff)
downloadswig-main.tar.gz
Change-Id: I47cef2be94299220d80265d949a95b58eee2c23b
Diffstat (limited to 'Examples/test-suite/java/cpp11_template_parameters_decltype_runme.java')
-rw-r--r--Examples/test-suite/java/cpp11_template_parameters_decltype_runme.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/Examples/test-suite/java/cpp11_template_parameters_decltype_runme.java b/Examples/test-suite/java/cpp11_template_parameters_decltype_runme.java
new file mode 100644
index 000000000..dd5fc2d25
--- /dev/null
+++ b/Examples/test-suite/java/cpp11_template_parameters_decltype_runme.java
@@ -0,0 +1,45 @@
+import cpp11_template_parameters_decltype.*;
+
+public class cpp11_template_parameters_decltype_runme {
+
+ static {
+ try {
+ System.loadLibrary("cpp11_template_parameters_decltype");
+ } 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[]) {
+ boolean show = false; // for debugging
+
+ cpp11_template_parameters_decltype.tester(show);
+ Json json0 = new Json("hi");
+ if (json0.getCtor() != 0)
+ throw new RuntimeException("json0 failed");
+ if (json0.mmm("bye") != 100)
+ throw new RuntimeException("json0.mmm failed");
+
+ Converter converter = new Converter();
+ Json json1 = new Json(converter);
+ if (json1.getCtor() != 1)
+ throw new RuntimeException("json1 failed");
+ if (json1.mmm(converter) != 101)
+ throw new RuntimeException("json1.mmm failed");
+
+ MapStringString myMapStringString = new MapStringString();
+ Json json2 = new Json(myMapStringString);
+ if (json2.getCtor() != 2)
+ throw new RuntimeException("json2 failed");
+ if (json2.mmm(myMapStringString) != 102)
+ throw new RuntimeException("json2.mmm failed");
+
+ VectorString myVectorString = new VectorString();
+ Json json3 = new Json(myVectorString);
+ if (json3.getCtor() != 3)
+ throw new RuntimeException("json3 failed");
+ if (json3.mmm(myVectorString) != 103)
+ throw new RuntimeException("json3.mmm failed");
+ }
+}