Merge branch 'master' into doxygen

Merge 3.0.12 release changes from master.
This commit is contained in:
Vadim Zeitlin 2017-02-01 02:21:35 +01:00
commit 294ab27b90
254 changed files with 4158 additions and 2457 deletions

View file

@ -31,6 +31,7 @@ CPP_TEST_CASES = \
java_director_exception_feature \
java_director_exception_feature_nspace \
java_director_ptrclass \
java_director_typemaps \
java_enums \
java_jnitypes \
java_lib_arrays_dimensionless \

View file

@ -0,0 +1,63 @@
import extend_template_method.*;
public class extend_template_method_runme {
static {
try {
System.loadLibrary("extend_template_method");
} 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[]) {
{
ExtendMe em = new ExtendMe();
{
double ret_double = em.do_stuff_double(1, 1.1);
if (ret_double != 1.1)
throw new RuntimeException("double failed " + ret_double);
String ret_string = em.do_stuff_string(1, "hello there");
if (!ret_string.equals("hello there"))
throw new RuntimeException("string failed " + ret_string);
}
{
double ret_double = em.do_overloaded_stuff(1.1);
if (ret_double != 1.1)
throw new RuntimeException("double failed " + ret_double);
String ret_string = em.do_overloaded_stuff("hello there");
if (!ret_string.equals("hello there"))
throw new RuntimeException("string failed " + ret_string);
}
if (ExtendMe.static_method(123) != 123)
throw new RuntimeException("static_method failed");
ExtendMe em2 = new ExtendMe(123);
}
{
TemplateExtend em = new TemplateExtend();
{
double ret_double = em.do_template_stuff_double(1, 1.1);
if (ret_double != 1.1)
throw new RuntimeException("double failed " + ret_double);
String ret_string = em.do_template_stuff_string(1, "hello there");
if (!ret_string.equals("hello there"))
throw new RuntimeException("string failed " + ret_string);
}
{
double ret_double = em.do_template_overloaded_stuff(1.1);
if (ret_double != 1.1)
throw new RuntimeException("double failed " + ret_double);
String ret_string = em.do_template_overloaded_stuff("hello there");
if (!ret_string.equals("hello there"))
throw new RuntimeException("string failed " + ret_string);
}
if (TemplateExtend.static_template_method(123) != 123)
throw new RuntimeException("static_template_method failed");
TemplateExtend em2 = new TemplateExtend(123);
}
}
}

View file

@ -0,0 +1,151 @@
// tests for java/typemaps.i used for directors
import java_director_typemaps.*;
import java.math.BigInteger;
public class java_director_typemaps_runme {
static {
try {
System.loadLibrary("java_director_typemaps");
} 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[]) {
Quux quux = new java_director_typemaps_MyQuux();
quux.etest();
}
}
class java_director_typemaps_MyQuux extends Quux {
public java_director_typemaps_MyQuux() {
super();
}
public void director_method_bool_output(
boolean[] bool_arg,
byte[] signed_char_arg,
short[] unsigned_char_arg,
short[] short_arg,
int[] unsigned_short_arg,
int[] int_arg,
long[] unsigned_int_arg,
int[] long_arg,
long[] unsigned_long_arg,
long[] long_long_arg,
// BigInteger[] unsigned_long_long_arg,
float[] float_arg,
double[] double_arg)
{
bool_arg[0] = true;
signed_char_arg[0] = 1;
unsigned_char_arg[0] = 2;
short_arg[0] = 3;
unsigned_short_arg[0] = 4;
int_arg[0] = 5;
unsigned_int_arg[0] = 6;
long_arg[0] = 7;
unsigned_long_arg[0] = 8;
long_long_arg[0] = 9;
// unsigned_long_long_arg[0] = 10;
float_arg[0] = 11;
double_arg[0] = 12;
}
public void director_method_bool_inout(
boolean[] bool_arg,
byte[] signed_char_arg,
short[] unsigned_char_arg,
short[] short_arg,
int[] unsigned_short_arg,
int[] int_arg,
long[] unsigned_int_arg,
int[] long_arg,
long[] unsigned_long_arg,
long[] long_long_arg,
// BigInteger[] unsigned_long_long_arg,
float[] float_arg,
double[] double_arg)
{
if (bool_arg[0]) throw new RuntimeException("unexpected value for bool_arg");
if (signed_char_arg[0] != 101) throw new RuntimeException("unexpected value for signed_char_arg");
if (unsigned_char_arg[0] != 101) throw new RuntimeException("unexpected value for unsigned_char_arg");
if (short_arg[0] != 101) throw new RuntimeException("unexpected value for short_arg");
if (unsigned_short_arg[0] != 101) throw new RuntimeException("unexpected value for unsigned_short_arg");
if (int_arg[0] != 101) throw new RuntimeException("unexpected value for int_arg");
if (unsigned_int_arg[0] != 101) throw new RuntimeException("unexpected value for unsigned_int_arg");
if (long_arg[0] != 101) throw new RuntimeException("unexpected value for long_arg");
if (unsigned_long_arg[0] != 101) throw new RuntimeException("unexpected value for unsigned_long_arg");
if (long_long_arg[0] != 101) throw new RuntimeException("unexpected value for long_long_arg");
// if (unsigned_long_long_arg[0] != 101) throw new RuntimeException("unexpected value for unsigned_long_long_arg");
if (float_arg[0] != 101) throw new RuntimeException("unexpected value for float_arg");
if (double_arg[0] != 101) throw new RuntimeException("unexpected value for double_arg");
bool_arg[0] = false;
signed_char_arg[0] = 11;
unsigned_char_arg[0] = 12;
short_arg[0] = 13;
unsigned_short_arg[0] = 14;
int_arg[0] = 15;
unsigned_int_arg[0] = 16;
long_arg[0] = 17;
unsigned_long_arg[0] = 18;
long_long_arg[0] = 19;
// unsigned_long_long_arg[0] = 110;
float_arg[0] = 111;
double_arg[0] = 112;
}
public void director_method_bool_nameless_args(
boolean[] bool_arg,
byte[] signed_char_arg,
short[] unsigned_char_arg,
short[] short_arg,
int[] unsigned_short_arg,
int[] int_arg,
long[] unsigned_int_arg,
int[] long_arg,
long[] unsigned_long_arg,
long[] long_long_arg,
// BigInteger[] unsigned_long_long_arg,
float[] float_arg,
double[] double_arg)
{
bool_arg[0] = true;
signed_char_arg[0] = 12;
unsigned_char_arg[0] = 13;
short_arg[0] = 14;
unsigned_short_arg[0] = 15;
int_arg[0] = 16;
unsigned_int_arg[0] = 17;
long_arg[0] = 18;
unsigned_long_arg[0] = 19;
long_long_arg[0] = 20;
// unsigned_long_long_arg[0] = 111;
float_arg[0] = 112;
double_arg[0] = 113;
}
}

View file

@ -0,0 +1,42 @@
import proxycode.*;
public class proxycode_runme {
static {
try {
System.loadLibrary("proxycode");
} 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[]) throws Throwable
{
if (new Proxy1().proxycode1(100) != 101)
throw new RuntimeException("Fail");
if (new Proxy2().proxycode2a(100) != 102)
throw new RuntimeException("Fail");
if (new Proxy2().proxycode2b(100) != 102)
throw new RuntimeException("Fail");
if (new Proxy3().proxycode3(100) != 103)
throw new RuntimeException("Fail");
if (new Proxy4().proxycode4(100) != 104)
throw new RuntimeException("Fail");
if (new Proxy4.Proxy4Nested().proxycode4nested(100) != 144)
throw new RuntimeException("Fail");
if (new Proxy5a().proxycode5((short)100) != (short)100)
throw new RuntimeException("Fail");
if (new Proxy5b().proxycode5(100) != 100)
throw new RuntimeException("Fail");
if (new Proxy5b().proxycode5(100, 100) != 255)
throw new RuntimeException("Fail");
long t1 = 10;
long t2 = 100;
Proxy6 p = new Proxy6().proxyUseT(t1, t2);
p.useT(t1, t2);
}
}

View file

@ -0,0 +1,18 @@
import template_default_cache.*;
public class template_default_cache_runme {
static {
try {
System.loadLibrary("template_default_cache");
} 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[]) {
AModelPtr ap = template_default_cache.get_mp_a();
BModelPtr bp = template_default_cache.get_mp_b();
}
}