1 // Runtime test checking the %typemap(ignore) macro
3 import ignore_parameter.*;
5 public class ignore_parameter_runme {
8 System.loadLibrary("ignore_parameter");
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 // Compilation will ensure the number of arguments and type are correct.
18 // Then check the return value is the same as the value given to the ignored parameter.
19 if (!ignore_parameter.jaguar(200, 0.0).equals("hello")) { System.err.println("Runtime Error in jaguar()");}
20 if (ignore_parameter.lotus("fast", 0.0) != 101) { System.err.println("Runtime Error in lotus()");}
21 if (ignore_parameter.tvr("fast", 200) != 8.8) { System.err.println("Runtime Error in tvr()");}
22 if (ignore_parameter.ferrari() != 101) { System.err.println("Runtime Error in ferrari()");}
24 SportsCars sc = new SportsCars();
25 if (!sc.daimler(200, 0.0).equals("hello")) { System.err.println("Runtime Error in daimler()");}
26 if (sc.astonmartin("fast", 0.0) != 101) { System.err.println("Runtime Error in astonmartin()");}
27 if (sc.bugatti("fast", 200) != 8.8) { System.err.println("Runtime Error in bugatti()");}
28 if (sc.lamborghini() != 101) { System.err.println("Runtime Error in lamborghini()");}
30 // Check constructors are also generated correctly
31 MiniCooper mc = new MiniCooper(200, 0.0);
32 MorrisMinor mm = new MorrisMinor("slow", 0.0);
33 FordAnglia fa = new FordAnglia("slow", 200);
34 AustinAllegro aa = new AustinAllegro();