Merge branch 'master' into gsoc2009-matevz
parser.y still to be fixed up Conflicts: Doc/Devel/engineering.html Examples/Makefile.in Lib/allegrocl/allegrocl.swg Lib/csharp/csharp.swg Lib/csharp/enums.swg Lib/csharp/enumsimple.swg Lib/csharp/enumtypesafe.swg Lib/java/java.swg Lib/python/pydocs.swg Lib/r/rtype.swg Source/Include/swigwarn.h Source/Modules/octave.cxx Source/Modules/python.cxx Source/Modules/ruby.cxx Source/Swig/scanner.c Source/Swig/stype.c Source/Swig/swig.h configure.ac
This commit is contained in:
commit
e805d5f925
1074 changed files with 54339 additions and 20134 deletions
|
|
@ -3,12 +3,13 @@
|
|||
#######################################################################
|
||||
|
||||
LANGUAGE = java
|
||||
JAVA = java
|
||||
JAVAC = javac
|
||||
JAVA = @JAVA@
|
||||
JAVAC = @JAVAC@
|
||||
JAVAFLAGS = -Xcheck:jni
|
||||
SCRIPTSUFFIX = _runme.java
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@/..
|
||||
top_builddir = @top_builddir@/..
|
||||
top_srcdir = ../@top_srcdir@
|
||||
top_builddir = ../@top_builddir@
|
||||
|
||||
C_TEST_CASES = \
|
||||
java_lib_arrays \
|
||||
|
|
@ -22,10 +23,12 @@ CPP_TEST_CASES = \
|
|||
intermediary_classname \
|
||||
java_constants \
|
||||
java_director \
|
||||
java_director_assumeoverride \
|
||||
java_enums \
|
||||
java_jnitypes \
|
||||
java_lib_arrays_dimensionless \
|
||||
java_lib_various \
|
||||
java_jnitypes \
|
||||
java_nspacewithoutpackage \
|
||||
java_pgcpp \
|
||||
java_pragmas \
|
||||
java_prepost \
|
||||
|
|
@ -38,11 +41,15 @@ include $(srcdir)/../common.mk
|
|||
|
||||
# Overridden variables here
|
||||
JAVA_PACKAGE = $*
|
||||
SWIGOPT += -package $(JAVA_PACKAGE)
|
||||
JAVA_PACKAGEOPT = -package $(JAVA_PACKAGE)
|
||||
SWIGOPT += $(JAVA_PACKAGEOPT)
|
||||
|
||||
# Custom tests - tests with additional commandline options
|
||||
java_nspacewithoutpackage.%: JAVA_PACKAGEOPT =
|
||||
nspace.%: JAVA_PACKAGE = $*Package
|
||||
nspace_extend.%: JAVA_PACKAGE = $*Package
|
||||
director_nspace.%: JAVA_PACKAGE = $*Package
|
||||
director_nspace_director_name_collision.%: JAVA_PACKAGE = $*Package
|
||||
|
||||
# Rules for the different types of tests
|
||||
%.cpptest:
|
||||
|
|
@ -78,7 +85,7 @@ run_testcase = \
|
|||
cd $(JAVA_PACKAGE) && $(COMPILETOOL) $(JAVAC) -classpath . `find . -name "*.java"` && cd .. && \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
$(COMPILETOOL) $(JAVAC) -classpath . -d . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||
env LD_LIBRARY_PATH="$(JAVA_PACKAGE):$$LD_LIBRARY_PATH" PATH="$(JAVA_PACKAGE):$$PATH" SHLIB_PATH="$(JAVA_PACKAGE):$$SHLIB_PATH" DYLD_LIBRARY_PATH="$(JAVA_PACKAGE):$$DYLD_LIBRARY_PATH" $(RUNTOOL) $(JAVA) -classpath . $*_runme; \
|
||||
env LD_LIBRARY_PATH="$(JAVA_PACKAGE):$$LD_LIBRARY_PATH" PATH="$(JAVA_PACKAGE):$$PATH" SHLIB_PATH="$(JAVA_PACKAGE):$$SHLIB_PATH" DYLD_LIBRARY_PATH="$(JAVA_PACKAGE):$$DYLD_LIBRARY_PATH" $(RUNTOOL) $(JAVA) $(JAVAFLAGS) -classpath . $*_runme; \
|
||||
fi
|
||||
|
||||
# Clean: remove testcase directories
|
||||
|
|
|
|||
24
Examples/test-suite/java/char_binary_runme.java
Normal file
24
Examples/test-suite/java/char_binary_runme.java
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import char_binary.*;
|
||||
|
||||
public class char_binary_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("char_binary");
|
||||
} 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[]) {
|
||||
Test t = new Test();
|
||||
byte[] hile = "hile".getBytes();
|
||||
byte[] hil0 = "hil\0".getBytes();
|
||||
if (t.strlen(hile) != 4)
|
||||
throw new RuntimeException("bad multi-arg typemap");
|
||||
|
||||
if (t.strlen(hil0) != 4)
|
||||
throw new RuntimeException("bad multi-arg typemap");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
import curiously_recurring_template_pattern.*;
|
||||
|
||||
public class curiously_recurring_template_pattern_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("curiously_recurring_template_pattern");
|
||||
} 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[]) {
|
||||
Derived d = new Derived();
|
||||
d.setBase1Param(1).setDerived1Param(10).setDerived2Param(20).setBase2Param(2);
|
||||
|
||||
if (d.getBase1Param() != 1)
|
||||
throw new RuntimeException("fail");
|
||||
if (d.getDerived1Param() != 10)
|
||||
throw new RuntimeException("fail");
|
||||
if (d.getBase2Param() != 2)
|
||||
throw new RuntimeException("fail");
|
||||
if (d.getDerived2Param() != 20)
|
||||
throw new RuntimeException("fail");
|
||||
}
|
||||
}
|
||||
|
||||
49
Examples/test-suite/java/director_binary_string_runme.java
Normal file
49
Examples/test-suite/java/director_binary_string_runme.java
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
import director_binary_string.*;
|
||||
|
||||
public class director_binary_string_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("director_binary_string");
|
||||
} 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[]) {
|
||||
Caller caller = new Caller();
|
||||
Callback callback = new DirectorBinaryStringCallback();
|
||||
caller.setCallback(callback);
|
||||
int sum = caller.call();
|
||||
caller.delCallback();
|
||||
|
||||
if (sum != 9*2*8 + 13*3*5)
|
||||
throw new RuntimeException("Unexpected sum: " + sum);
|
||||
|
||||
new Callback().run(null, null);
|
||||
callback = new DirectorBinaryStringCallback();
|
||||
caller.setCallback(callback);
|
||||
caller.call_null();
|
||||
}
|
||||
}
|
||||
|
||||
class DirectorBinaryStringCallback extends Callback {
|
||||
public DirectorBinaryStringCallback() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(byte[] dataBufferAA, byte[] dataBufferBB)
|
||||
{
|
||||
if (dataBufferAA != null)
|
||||
for (int i = 0; i < dataBufferAA.length; i++)
|
||||
dataBufferAA[i] = (byte)(dataBufferAA[i] * 2);
|
||||
|
||||
if (dataBufferBB != null)
|
||||
for (int i = 0; i < dataBufferBB.length; i++)
|
||||
dataBufferBB[i] = (byte)(dataBufferBB[i] * 3);
|
||||
}
|
||||
}
|
||||
|
||||
48
Examples/test-suite/java/director_nspace_runme.java
Normal file
48
Examples/test-suite/java/director_nspace_runme.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
// Make sure that directors are connected and disconnected when used inconjunction with
|
||||
// the %nspace feature
|
||||
|
||||
public class director_nspace_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("director_nspace");
|
||||
} 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[]) {
|
||||
director_nspace_MyBarFoo myBarFoo =
|
||||
new director_nspace_MyBarFoo();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class director_nspace_MyBarFoo extends director_nspacePackage.TopLevel.Bar.Foo {
|
||||
|
||||
@Override
|
||||
public String ping() {
|
||||
return "director_nspace_MyBarFoo.ping();";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String pong() {
|
||||
return "director_nspace_MyBarFoo.pong();" + ping();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String fooBar(director_nspacePackage.TopLevel.Bar.FooBar fooBar) {
|
||||
return fooBar.FooBarDo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public director_nspacePackage.TopLevel.Bar.Foo makeFoo() {
|
||||
return new director_nspacePackage.TopLevel.Bar.Foo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public director_nspacePackage.TopLevel.Bar.FooBar makeFooBar() {
|
||||
return new director_nspacePackage.TopLevel.Bar.FooBar();
|
||||
}
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ public class director_protected_runme {
|
|||
Foo f = b.create();
|
||||
director_protected_FooBar fb = new director_protected_FooBar();
|
||||
director_protected_FooBar2 fb2 = new director_protected_FooBar2();
|
||||
director_protected_FooBar3 fb3 = new director_protected_FooBar3();
|
||||
|
||||
{
|
||||
String s = fb.used();
|
||||
|
|
@ -60,11 +61,34 @@ public class director_protected_runme {
|
|||
if ( !Modifier.isProtected(method.getModifiers()) )
|
||||
throw new RuntimeException("Foo::ping should be protected" );
|
||||
|
||||
method = b.getClass().getDeclaredMethod("cheer", (java.lang.Class[])null);
|
||||
if ( !Modifier.isProtected(method.getModifiers()) )
|
||||
throw new RuntimeException("Bar::cheer should be protected" );
|
||||
|
||||
method = f.getClass().getDeclaredMethod("cheer", (java.lang.Class[])null);
|
||||
if ( !Modifier.isProtected(method.getModifiers()) )
|
||||
throw new RuntimeException("Foo::cheer should be protected" );
|
||||
|
||||
} catch (NoSuchMethodException n) {
|
||||
throw new RuntimeException("NoSuchmethodException caught. Test failed.");
|
||||
throw new RuntimeException(n);
|
||||
} catch (SecurityException s) {
|
||||
throw new RuntimeException("SecurityException caught. Test failed.");
|
||||
}
|
||||
|
||||
if (!fb3.cheer().equals("director_protected_FooBar3::cheer();"))
|
||||
throw new RuntimeException("bad fb3::cheer");
|
||||
|
||||
if (!fb2.callping().equals("director_protected_FooBar2::ping();"))
|
||||
throw new RuntimeException("bad fb2.callping");
|
||||
|
||||
if (!fb2.callcheer().equals("director_protected_FooBar2::pang();Bar::pong();Foo::pong();director_protected_FooBar2::ping();"))
|
||||
throw new RuntimeException("bad fb2.callcheer");
|
||||
|
||||
if (!fb3.callping().equals("Bar::ping();"))
|
||||
throw new RuntimeException("bad fb3.callping");
|
||||
|
||||
if (!fb3.callcheer().equals("director_protected_FooBar3::cheer();"))
|
||||
throw new RuntimeException("bad fb3.callcheer");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -83,3 +107,9 @@ class director_protected_FooBar2 extends Bar {
|
|||
}
|
||||
}
|
||||
|
||||
class director_protected_FooBar3 extends Bar {
|
||||
public String cheer() {
|
||||
return "director_protected_FooBar3::cheer();";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
48
Examples/test-suite/java/director_smartptr_runme.java
Normal file
48
Examples/test-suite/java/director_smartptr_runme.java
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
// Make sure that directors are connected and disconnected when used inconjunction with
|
||||
// being a smart pointer
|
||||
|
||||
public class director_smartptr_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("director_smartptr");
|
||||
} 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[]) {
|
||||
director_smartptr_MyBarFoo myBarFoo =
|
||||
new director_smartptr_MyBarFoo();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class director_smartptr_MyBarFoo extends director_smartptr.Foo {
|
||||
|
||||
@Override
|
||||
public String ping() {
|
||||
return "director_smartptr_MyBarFoo.ping();";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String pong() {
|
||||
return "director_smartptr_MyBarFoo.pong();" + ping();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String fooBar(director_smartptr.FooBar fooBar) {
|
||||
return fooBar.FooBarDo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public director_smartptr.Foo makeFoo() {
|
||||
return new director_smartptr.Foo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public director_smartptr.FooBar makeFooBar() {
|
||||
return new director_smartptr.FooBar();
|
||||
}
|
||||
}
|
||||
33
Examples/test-suite/java/enum_forward_runme.java
Normal file
33
Examples/test-suite/java/enum_forward_runme.java
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
import enum_forward.*;
|
||||
|
||||
public class enum_forward_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("enum_forward");
|
||||
} 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[])
|
||||
{
|
||||
try {
|
||||
ForwardEnum1 f1 = enum_forward.get_enum1();
|
||||
f1 = enum_forward.test_function1(f1);
|
||||
} catch (IllegalArgumentException e) {
|
||||
}
|
||||
|
||||
try {
|
||||
ForwardEnum2 f2 = enum_forward.get_enum2();
|
||||
f2 = enum_forward.test_function2(f2);
|
||||
} catch (IllegalArgumentException e) {
|
||||
}
|
||||
|
||||
ForwardEnum3 f3 = enum_forward.get_enum3();
|
||||
f3 = enum_forward.test_function3(f3);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -416,6 +416,28 @@ public class enum_thorough_proper_runme {
|
|||
if (enum_thorough_proper.repeatTest(repeat.llast).swigValue() != 3) throw new RuntimeException("repeatTest 5 failed");
|
||||
if (enum_thorough_proper.repeatTest(repeat.end).swigValue() != 3) throw new RuntimeException("repeatTest 6 failed");
|
||||
}
|
||||
// different types
|
||||
{
|
||||
if (enum_thorough_proper.differentTypesTest(DifferentTypes.typeint).swigValue() != 10) throw new RuntimeException("differentTypes 1 failed");
|
||||
if (enum_thorough_proper.differentTypesTest(DifferentTypes.typeboolfalse).swigValue() != 0) throw new RuntimeException("differentTypes 2 failed");
|
||||
if (enum_thorough_proper.differentTypesTest(DifferentTypes.typebooltrue).swigValue() != 1) throw new RuntimeException("differentTypes 3 failed");
|
||||
if (enum_thorough_proper.differentTypesTest(DifferentTypes.typebooltwo).swigValue() != 2) throw new RuntimeException("differentTypes 4 failed");
|
||||
if (enum_thorough_proper.differentTypesTest(DifferentTypes.typechar).swigValue() != 'C') throw new RuntimeException("differentTypes 5 failed");
|
||||
if (enum_thorough_proper.differentTypesTest(DifferentTypes.typedefaultint).swigValue() != 'D') throw new RuntimeException("differentTypes 6 failed");
|
||||
|
||||
int global_enum = enum_thorough_proper.global_typeint;
|
||||
if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 10) throw new RuntimeException("global differentTypes 1 failed");
|
||||
global_enum = enum_thorough_proper.global_typeboolfalse;
|
||||
if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 0) throw new RuntimeException("global differentTypes 2 failed");
|
||||
global_enum = enum_thorough_proper.global_typebooltrue;
|
||||
if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 1) throw new RuntimeException("global differentTypes 3 failed");
|
||||
global_enum = enum_thorough_proper.global_typebooltwo;
|
||||
if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 2) throw new RuntimeException("global differentTypes 4 failed");
|
||||
global_enum = enum_thorough_proper.global_typechar;
|
||||
if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 'C') throw new RuntimeException("global differentTypes 5 failed");
|
||||
global_enum = enum_thorough_proper.global_typedefaultint;
|
||||
if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 'D') throw new RuntimeException("global differentTypes 6 failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -416,6 +416,28 @@ public class enum_thorough_runme {
|
|||
if (enum_thorough.repeatTest(repeat.llast).swigValue() != 3) throw new RuntimeException("repeatTest 5 failed");
|
||||
if (enum_thorough.repeatTest(repeat.end).swigValue() != 3) throw new RuntimeException("repeatTest 6 failed");
|
||||
}
|
||||
// different types
|
||||
{
|
||||
if (enum_thorough.differentTypesTest(DifferentTypes.typeint).swigValue() != 10) throw new RuntimeException("differentTypes 1 failed");
|
||||
if (enum_thorough.differentTypesTest(DifferentTypes.typeboolfalse).swigValue() != 0) throw new RuntimeException("differentTypes 2 failed");
|
||||
if (enum_thorough.differentTypesTest(DifferentTypes.typebooltrue).swigValue() != 1) throw new RuntimeException("differentTypes 3 failed");
|
||||
if (enum_thorough.differentTypesTest(DifferentTypes.typebooltwo).swigValue() != 2) throw new RuntimeException("differentTypes 4 failed");
|
||||
if (enum_thorough.differentTypesTest(DifferentTypes.typechar).swigValue() != 'C') throw new RuntimeException("differentTypes 5 failed");
|
||||
if (enum_thorough.differentTypesTest(DifferentTypes.typedefaultint).swigValue() != 'D') throw new RuntimeException("differentTypes 6 failed");
|
||||
|
||||
int global_enum = enum_thorough.global_typeint;
|
||||
if (enum_thorough.globalDifferentTypesTest(global_enum) != 10) throw new RuntimeException("global differentTypes 1 failed");
|
||||
global_enum = enum_thorough.global_typeboolfalse;
|
||||
if (enum_thorough.globalDifferentTypesTest(global_enum) != 0) throw new RuntimeException("global differentTypes 2 failed");
|
||||
global_enum = enum_thorough.global_typebooltrue;
|
||||
if (enum_thorough.globalDifferentTypesTest(global_enum) != 1) throw new RuntimeException("global differentTypes 3 failed");
|
||||
global_enum = enum_thorough.global_typebooltwo;
|
||||
if (enum_thorough.globalDifferentTypesTest(global_enum) != 2) throw new RuntimeException("global differentTypes 4 failed");
|
||||
global_enum = enum_thorough.global_typechar;
|
||||
if (enum_thorough.globalDifferentTypesTest(global_enum) != 'C') throw new RuntimeException("global differentTypes 5 failed");
|
||||
global_enum = enum_thorough.global_typedefaultint;
|
||||
if (enum_thorough.globalDifferentTypesTest(global_enum) != 'D') throw new RuntimeException("global differentTypes 6 failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -416,6 +416,28 @@ public class enum_thorough_simple_runme {
|
|||
if (enum_thorough_simple.repeatTest(enum_thorough_simpleConstants.llast) != 3) throw new RuntimeException("repeatTest 5 failed");
|
||||
if (enum_thorough_simple.repeatTest(enum_thorough_simpleConstants.end) != 3) throw new RuntimeException("repeatTest 6 failed");
|
||||
}
|
||||
// different types
|
||||
{
|
||||
if (enum_thorough_simple.differentTypesTest(enum_thorough_simpleConstants.typeint) != 10) throw new RuntimeException("differentTypes 1 failed");
|
||||
if (enum_thorough_simple.differentTypesTest(enum_thorough_simpleConstants.typeboolfalse) != 0) throw new RuntimeException("differentTypes 2 failed");
|
||||
if (enum_thorough_simple.differentTypesTest(enum_thorough_simpleConstants.typebooltrue) != 1) throw new RuntimeException("differentTypes 3 failed");
|
||||
if (enum_thorough_simple.differentTypesTest(enum_thorough_simpleConstants.typebooltwo) != 2) throw new RuntimeException("differentTypes 4 failed");
|
||||
if (enum_thorough_simple.differentTypesTest(enum_thorough_simpleConstants.typechar) != 'C') throw new RuntimeException("differentTypes 5 failed");
|
||||
if (enum_thorough_simple.differentTypesTest(enum_thorough_simpleConstants.typedefaultint) != 'D') throw new RuntimeException("differentTypes 6 failed");
|
||||
|
||||
int global_enum = enum_thorough_simple.global_typeint;
|
||||
if (enum_thorough_simple.globalDifferentTypesTest(global_enum) != 10) throw new RuntimeException("global differentTypes 1 failed");
|
||||
global_enum = enum_thorough_simple.global_typeboolfalse;
|
||||
if (enum_thorough_simple.globalDifferentTypesTest(global_enum) != 0) throw new RuntimeException("global differentTypes 2 failed");
|
||||
global_enum = enum_thorough_simple.global_typebooltrue;
|
||||
if (enum_thorough_simple.globalDifferentTypesTest(global_enum) != 1) throw new RuntimeException("global differentTypes 3 failed");
|
||||
global_enum = enum_thorough_simple.global_typebooltwo;
|
||||
if (enum_thorough_simple.globalDifferentTypesTest(global_enum) != 2) throw new RuntimeException("global differentTypes 4 failed");
|
||||
global_enum = enum_thorough_simple.global_typechar;
|
||||
if (enum_thorough_simple.globalDifferentTypesTest(global_enum) != 'C') throw new RuntimeException("global differentTypes 5 failed");
|
||||
global_enum = enum_thorough_simple.global_typedefaultint;
|
||||
if (enum_thorough_simple.globalDifferentTypesTest(global_enum) != 'D') throw new RuntimeException("global differentTypes 6 failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -416,6 +416,28 @@ public class enum_thorough_typeunsafe_runme {
|
|||
if (enum_thorough_typeunsafe.repeatTest(repeat.llast) != 3) throw new RuntimeException("repeatTest 5 failed");
|
||||
if (enum_thorough_typeunsafe.repeatTest(repeat.end) != 3) throw new RuntimeException("repeatTest 6 failed");
|
||||
}
|
||||
// different types
|
||||
{
|
||||
if (enum_thorough_typeunsafe.differentTypesTest(DifferentTypes.typeint) != 10) throw new RuntimeException("differentTypes 1 failed");
|
||||
if (enum_thorough_typeunsafe.differentTypesTest(DifferentTypes.typeboolfalse) != 0) throw new RuntimeException("differentTypes 2 failed");
|
||||
if (enum_thorough_typeunsafe.differentTypesTest(DifferentTypes.typebooltrue) != 1) throw new RuntimeException("differentTypes 3 failed");
|
||||
if (enum_thorough_typeunsafe.differentTypesTest(DifferentTypes.typebooltwo) != 2) throw new RuntimeException("differentTypes 4 failed");
|
||||
if (enum_thorough_typeunsafe.differentTypesTest(DifferentTypes.typechar) != 'C') throw new RuntimeException("differentTypes 5 failed");
|
||||
if (enum_thorough_typeunsafe.differentTypesTest(DifferentTypes.typedefaultint) != 'D') throw new RuntimeException("differentTypes 6 failed");
|
||||
|
||||
int global_enum = enum_thorough_typeunsafe.global_typeint;
|
||||
if (enum_thorough_typeunsafe.globalDifferentTypesTest(global_enum) != 10) throw new RuntimeException("global differentTypes 1 failed");
|
||||
global_enum = enum_thorough_typeunsafe.global_typeboolfalse;
|
||||
if (enum_thorough_typeunsafe.globalDifferentTypesTest(global_enum) != 0) throw new RuntimeException("global differentTypes 2 failed");
|
||||
global_enum = enum_thorough_typeunsafe.global_typebooltrue;
|
||||
if (enum_thorough_typeunsafe.globalDifferentTypesTest(global_enum) != 1) throw new RuntimeException("global differentTypes 3 failed");
|
||||
global_enum = enum_thorough_typeunsafe.global_typebooltwo;
|
||||
if (enum_thorough_typeunsafe.globalDifferentTypesTest(global_enum) != 2) throw new RuntimeException("global differentTypes 4 failed");
|
||||
global_enum = enum_thorough_typeunsafe.global_typechar;
|
||||
if (enum_thorough_typeunsafe.globalDifferentTypesTest(global_enum) != 'C') throw new RuntimeException("global differentTypes 5 failed");
|
||||
global_enum = enum_thorough_typeunsafe.global_typedefaultint;
|
||||
if (enum_thorough_typeunsafe.globalDifferentTypesTest(global_enum) != 'D') throw new RuntimeException("global differentTypes 6 failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
import extend_constructor_destructor.*;
|
||||
|
||||
public class extend_constructor_destructor_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("extend_constructor_destructor");
|
||||
} 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[]) {
|
||||
AStruct a = new AStruct(10);
|
||||
checkGlobal(10);
|
||||
BStruct b = new BStruct(20);
|
||||
checkGlobal(20);
|
||||
CStruct c = new CStruct(30);
|
||||
checkGlobal(30);
|
||||
DStruct d = new DStruct(40);
|
||||
checkGlobal(40);
|
||||
EStruct e = new EStruct(50);
|
||||
checkGlobal(50);
|
||||
FStruct f = new FStruct(60);
|
||||
checkGlobal(60);
|
||||
GStruct g = new GStruct(70);
|
||||
checkGlobal(70);
|
||||
|
||||
a.delete();
|
||||
checkGlobal(-10);
|
||||
b.delete();
|
||||
checkGlobal(-20);
|
||||
c.delete();
|
||||
checkGlobal(-30);
|
||||
d.delete();
|
||||
checkGlobal(-40);
|
||||
e.delete();
|
||||
checkGlobal(-50);
|
||||
f.delete();
|
||||
checkGlobal(-60);
|
||||
g.delete();
|
||||
checkGlobal(-70);
|
||||
}
|
||||
|
||||
public static void checkGlobal(int val) {
|
||||
int global = extend_constructor_destructor.getGlobalVar();
|
||||
if (global != val)
|
||||
throw new RuntimeException("global value incorrect. Expected: " + val + " got: " + global);
|
||||
}
|
||||
}
|
||||
|
||||
25
Examples/test-suite/java/extend_special_variables_runme.java
Normal file
25
Examples/test-suite/java/extend_special_variables_runme.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
import extend_special_variables.*;
|
||||
|
||||
public class extend_special_variables_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("extend_special_variables");
|
||||
} 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[])
|
||||
{
|
||||
ForExtensionNewName f = new ForExtensionNewName();
|
||||
verify(f.extended_renamed(), "name:extended symname:extended_renamed wrapname: overname:__SWIG_0 decl:ForExtension::extended() fulldecl:char const * ForExtension::extended() parentclasssymname:ForExtensionNewName parentclassname:ForExtension");
|
||||
verify(f.extended_renamed(10), "name:extended symname:extended_renamed wrapname: overname:__SWIG_1 decl:ForExtension::extended(int) fulldecl:char const * ForExtension::extended(int) parentclasssymname:ForExtensionNewName parentclassname:ForExtension");
|
||||
}
|
||||
static void verify(String received, String expected) {
|
||||
if (!received.equals(expected))
|
||||
throw new RuntimeException("Incorrect, received: " + received);
|
||||
}
|
||||
}
|
||||
65
Examples/test-suite/java/extend_typedef_class_runme.java
Normal file
65
Examples/test-suite/java/extend_typedef_class_runme.java
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
import extend_typedef_class.*;
|
||||
|
||||
public class extend_typedef_class_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("extend_typedef_class");
|
||||
} 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[]) {
|
||||
// No namespace
|
||||
{
|
||||
AClass s = new AClass();
|
||||
s.setMembervar(10);
|
||||
checkMatch(s.getvar(), 10);
|
||||
}
|
||||
{
|
||||
BClass s = new BClass();
|
||||
s.setMembervar(20);
|
||||
checkMatch(s.getvar(), 20);
|
||||
}
|
||||
{
|
||||
CClass s = new CClass();
|
||||
s.setMembervar(30);
|
||||
checkMatch(s.getvar(), 30);
|
||||
}
|
||||
{
|
||||
DClass s = new DClass();
|
||||
s.setMembervar(40);
|
||||
checkMatch(s.getvar(), 40);
|
||||
}
|
||||
|
||||
// In namespace
|
||||
{
|
||||
AStruct s = new AStruct();
|
||||
s.setMembervar(10);
|
||||
checkMatch(s.getvar(), 10);
|
||||
}
|
||||
{
|
||||
BStruct s = new BStruct();
|
||||
s.setMembervar(20);
|
||||
checkMatch(s.getvar(), 20);
|
||||
}
|
||||
{
|
||||
CStruct s = new CStruct();
|
||||
s.setMembervar(30);
|
||||
checkMatch(s.getvar(), 30);
|
||||
}
|
||||
{
|
||||
DStruct s = new DStruct();
|
||||
s.setMembervar(40);
|
||||
checkMatch(s.getvar(), 40);
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkMatch(int expected, int got) {
|
||||
if (expected != got)
|
||||
throw new RuntimeException("Value incorrect. Expected: " + expected + " got: " + got);
|
||||
}
|
||||
}
|
||||
|
||||
53
Examples/test-suite/java/friends_runme.java
Normal file
53
Examples/test-suite/java/friends_runme.java
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
import friends.*;
|
||||
|
||||
public class friends_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("friends");
|
||||
} 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
|
||||
{
|
||||
A a = new A(2);
|
||||
|
||||
if (friends.get_val1(a) != 2)
|
||||
throw new RuntimeException("failed");
|
||||
if (friends.get_val2(a) != 4)
|
||||
throw new RuntimeException("failed");
|
||||
if (friends.get_val3(a) != 6)
|
||||
throw new RuntimeException("failed");
|
||||
|
||||
// nice overload working fine
|
||||
if (friends.get_val1(1,2,3) != 1)
|
||||
throw new RuntimeException("failed");
|
||||
|
||||
B b = new B(3);
|
||||
|
||||
// David's case
|
||||
if (friends.mix(a,b) != 5)
|
||||
throw new RuntimeException("failed");
|
||||
|
||||
D_d di = new D_d(2);
|
||||
D_d dd = new D_d(3.3);
|
||||
|
||||
// incredible template overloading working just fine
|
||||
if (friends.get_val1(di) != 2)
|
||||
throw new RuntimeException("failed");
|
||||
if (friends.get_val1(dd) != 3.3)
|
||||
throw new RuntimeException("failed");
|
||||
|
||||
friends.set(di, 4);
|
||||
friends.set(dd, 1.3);
|
||||
|
||||
if (friends.get_val1(di) != 4)
|
||||
throw new RuntimeException("failed");
|
||||
if (friends.get_val1(dd) != 1.3)
|
||||
throw new RuntimeException("failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -13,8 +13,38 @@ public class global_namespace_runme {
|
|||
|
||||
public static void main(String argv[]) {
|
||||
|
||||
KlassMethods.methodA(new Klass1(), new Klass2(), new Klass3(), new Klass4(), new Klass5(), new Klass6(), new Klass7());
|
||||
KlassMethods.methodB(new Klass1(), new Klass2(), new Klass3(), new Klass4(), new Klass5(), new Klass6(), new Klass7());
|
||||
Klass1 k1 = new Klass1();
|
||||
Klass2 k2 = new Klass2();
|
||||
Klass3 k3 = new Klass3();
|
||||
Klass4 k4 = new Klass4();
|
||||
Klass5 k5 = new Klass5();
|
||||
Klass6 k6 = new Klass6();
|
||||
Klass7 k7 = new Klass7();
|
||||
|
||||
KlassMethods.methodA(k1, k2, k3, k4, k5, k6, k7);
|
||||
KlassMethods.methodB(k1, k2, k3, k4, k5, k6, k7);
|
||||
|
||||
k1 = global_namespace.getKlass1A();
|
||||
k2 = global_namespace.getKlass2A();
|
||||
k3 = global_namespace.getKlass3A();
|
||||
k4 = global_namespace.getKlass4A();
|
||||
k5 = global_namespace.getKlass5A();
|
||||
k6 = global_namespace.getKlass6A();
|
||||
k7 = global_namespace.getKlass7A();
|
||||
|
||||
KlassMethods.methodA(k1, k2, k3, k4, k5, k6, k7);
|
||||
KlassMethods.methodB(k1, k2, k3, k4, k5, k6, k7);
|
||||
|
||||
k1 = global_namespace.getKlass1B();
|
||||
k2 = global_namespace.getKlass2B();
|
||||
k3 = global_namespace.getKlass3B();
|
||||
k4 = global_namespace.getKlass4B();
|
||||
k5 = global_namespace.getKlass5B();
|
||||
k6 = global_namespace.getKlass6B();
|
||||
k7 = global_namespace.getKlass7B();
|
||||
|
||||
KlassMethods.methodA(k1, k2, k3, k4, k5, k6, k7);
|
||||
KlassMethods.methodB(k1, k2, k3, k4, k5, k6, k7);
|
||||
|
||||
XYZMethods.methodA(new XYZ1(), new XYZ2(), new XYZ3(), new XYZ4(), new XYZ5(), new XYZ6(), new XYZ7());
|
||||
XYZMethods.methodB(new XYZ1(), new XYZ2(), new XYZ3(), new XYZ4(), new XYZ5(), new XYZ6(), new XYZ7());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
import java_director_assumeoverride.*;
|
||||
|
||||
public class java_director_assumeoverride_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("java_director_assumeoverride");
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
static class MyOverrideMe extends OverrideMe {
|
||||
}
|
||||
|
||||
public static void main(String argv[]) {
|
||||
OverrideMe overrideMe = new MyOverrideMe();
|
||||
|
||||
// MyOverrideMe doesn't actually override func(), but because assumeoverride
|
||||
// was set to true, the C++ side will believe it was overridden.
|
||||
if (!java_director_assumeoverride.isFuncOverridden(overrideMe)) {
|
||||
throw new RuntimeException ( "isFuncOverridden()" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -23,6 +23,7 @@ public class java_lib_arrays_runme {
|
|||
|
||||
// Create arrays for all the array types that ArrayStruct can handle
|
||||
String array_c = "X";
|
||||
byte[] array_c_extra = {11, 22};
|
||||
byte[] array_sc = {10, 20};
|
||||
short[] array_uc = {101, 201};
|
||||
short[] array_s = {1002, 2002};
|
||||
|
|
@ -105,6 +106,12 @@ public class java_lib_arrays_runme {
|
|||
|
||||
as.setArray_struct(array_struct);
|
||||
check_struct_array(array_struct, as.getArray_struct());
|
||||
|
||||
// Extended element (for char[])
|
||||
ArrayStructExtra ase = new ArrayStructExtra();
|
||||
ase.setArray_c2(array_c_extra);
|
||||
check_byte_array(array_c_extra, ase.getArray_c2());
|
||||
|
||||
}
|
||||
|
||||
// Functions to check that the array values were set correctly
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ public class java_lib_various_runme {
|
|||
if ( !langs[i].equals(newLangs[i]) )
|
||||
throw new RuntimeException("Languages verify failed " + i + " " + langs[i] + "|" + newLangs[i]);
|
||||
|
||||
// STRING_ARRAY null
|
||||
java_lib_various.setLanguages(null);
|
||||
if (java_lib_various.getLanguages() != null)
|
||||
throw new RuntimeException("languages should be null");
|
||||
|
||||
// STRING_RET test
|
||||
{
|
||||
String stringOutArray[] = { "" };
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public class java_prepost_runme {
|
|||
{
|
||||
// ensure checked exception is generated
|
||||
try {
|
||||
PrePostThrows ppt = new PrePostThrows(null);
|
||||
PrePostThrows ppt = new PrePostThrows(null, true);
|
||||
} catch (InstantiationException e) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
|
||||
import li_boost_shared_ptr_template.*;
|
||||
|
||||
public class li_boost_shared_ptr_template_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("li_boost_shared_ptr_template");
|
||||
} 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[]) {
|
||||
{
|
||||
BaseINTEGER b = new BaseINTEGER();
|
||||
DerivedINTEGER d = new DerivedINTEGER();
|
||||
if (b.bar() != 1)
|
||||
throw new RuntimeException("test 1");
|
||||
if (d.bar() != 2)
|
||||
throw new RuntimeException("test 2");
|
||||
if (li_boost_shared_ptr_template.bar_getter(b) != 1)
|
||||
throw new RuntimeException("test 3");
|
||||
if (li_boost_shared_ptr_template.bar_getter(d) != 2)
|
||||
throw new RuntimeException("test 4");
|
||||
}
|
||||
|
||||
{
|
||||
BaseDefaultInt b = new BaseDefaultInt();
|
||||
DerivedDefaultInt d = new DerivedDefaultInt();
|
||||
DerivedDefaultInt2 d2 = new DerivedDefaultInt2();
|
||||
if (b.bar2() != 3)
|
||||
throw new RuntimeException("test 5");
|
||||
if (d.bar2() != 4)
|
||||
throw new RuntimeException("test 6");
|
||||
if (d2.bar2() != 4)
|
||||
throw new RuntimeException("test 6");
|
||||
if (li_boost_shared_ptr_template.bar2_getter(b) != 3)
|
||||
throw new RuntimeException("test 7");
|
||||
if (li_boost_shared_ptr_template.bar2_getter(d) != 4)
|
||||
throw new RuntimeException("test 8");
|
||||
if (li_boost_shared_ptr_template.bar2_getter(d2) != 4)
|
||||
throw new RuntimeException("test 8");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
27
Examples/test-suite/java/li_std_vector_enum_runme.java
Normal file
27
Examples/test-suite/java/li_std_vector_enum_runme.java
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import li_std_vector_enum.*;
|
||||
|
||||
public class li_std_vector_enum_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("li_std_vector_enum");
|
||||
} 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
|
||||
{
|
||||
EnumVector ev = new EnumVector();
|
||||
|
||||
check(ev.getNums().get(0).swigValue(), 10);
|
||||
check(ev.getNums().get(1).swigValue(), 20);
|
||||
check(ev.getNums().get(2).swigValue(), 30);
|
||||
}
|
||||
|
||||
private static void check(int a, int b) {
|
||||
if (a != b)
|
||||
throw new RuntimeException("values don't match");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
import namespace_forward_declaration.*;
|
||||
|
||||
public class namespace_forward_declaration_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("namespace_forward_declaration");
|
||||
} 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[]) {
|
||||
XXX xxx = new XXX();
|
||||
namespace_forward_declaration.testXXX1(xxx);
|
||||
namespace_forward_declaration.testXXX2(xxx);
|
||||
namespace_forward_declaration.testXXX3(xxx);
|
||||
YYY yyy = new YYY();
|
||||
namespace_forward_declaration.testYYY1(yyy);
|
||||
namespace_forward_declaration.testYYY2(yyy);
|
||||
namespace_forward_declaration.testYYY3(yyy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ public class nspace_runme {
|
|||
throw new RuntimeException("Transmission2 wrong");
|
||||
|
||||
// turn feature off / ignoring
|
||||
nspacePackage.Outer.nspace ns = new nspacePackage.Outer.nspace();
|
||||
nspacePackage.Outer.namespce ns = new nspacePackage.Outer.namespce();
|
||||
nspacePackage.NoNSpacePlease nons = new nspacePackage.NoNSpacePlease();
|
||||
|
||||
// Derived class
|
||||
|
|
|
|||
|
|
@ -19,5 +19,8 @@ public class pointer_reference_runme {
|
|||
Struct ss = new Struct(20);
|
||||
pointer_reference.set(ss);
|
||||
if (Struct.getInstance().getValue() != 20) throw new RuntimeException("set test failed");
|
||||
|
||||
if (pointer_reference.overloading(1) != 111) throw new RuntimeException("overload test 1 failed");
|
||||
if (pointer_reference.overloading(ss) != 222) throw new RuntimeException("overload test 2 failed");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
68
Examples/test-suite/java/preproc_line_file_runme.java
Normal file
68
Examples/test-suite/java/preproc_line_file_runme.java
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
import preproc_line_file.*;
|
||||
|
||||
public class preproc_line_file_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("preproc_line_file");
|
||||
} 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 String FILENAME_WINDOWS = "..\\..\\..\\..\\Examples\\test-suite\\preproc_line_file.i";
|
||||
public static String FILENAME_UNIX = "../../../../Examples/test-suite/preproc_line_file.i";
|
||||
public static void main(String argv[]) throws Throwable
|
||||
{
|
||||
int myline = preproc_line_file.MYLINE;
|
||||
int myline_adjusted = preproc_line_file.MYLINE_ADJUSTED;
|
||||
if (myline != 4)
|
||||
throw new RuntimeException("preproc failure");
|
||||
if (myline + 100 + 1 != myline_adjusted)
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
String myfile = preproc_line_file.MYFILE;
|
||||
String myfile_adjusted = preproc_line_file.MYFILE_ADJUSTED;
|
||||
if (!(myfile.equals(FILENAME_UNIX) || myfile.equals(FILENAME_WINDOWS)))
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
if (!(myfile_adjusted.equals(FILENAME_UNIX + ".bak") || myfile_adjusted.equals(FILENAME_WINDOWS + ".bak")))
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
if (!preproc_line_file.MY_STRINGNUM_A.equals("my15"))
|
||||
throw new RuntimeException("preproc failed MY_STRINGNUM_A");
|
||||
|
||||
if (!preproc_line_file.MY_STRINGNUM_B.equals("my16"))
|
||||
throw new RuntimeException("preproc failed MY_STRINGNUM_B");
|
||||
|
||||
if (preproc_line_file.getThing27() != -1)
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
if (preproc_line_file.getThing28() != -2)
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
if (preproc_line_file.MYLINE2 != 30)
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
if (SillyStruct.LINE_NUMBER != 52)
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
if (SillyMacroClass.LINE_NUM != 56)
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
if (SillyMultipleMacroStruct.LINE_NUM != 81)
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
if (preproc_line_file.INLINE_LINE != 87)
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
String inlineFile = preproc_line_file.INLINE_FILE;
|
||||
if (!(inlineFile.equals(FILENAME_UNIX) || inlineFile.equals(FILENAME_WINDOWS)))
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
if (Slash.LINE_NUM != 93)
|
||||
throw new RuntimeException("preproc failure");
|
||||
|
||||
}
|
||||
}
|
||||
14
Examples/test-suite/java/rename_pcre_encoder_runme.java
Normal file
14
Examples/test-suite/java/rename_pcre_encoder_runme.java
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import rename_pcre_encoder.*;
|
||||
|
||||
public class rename_pcre_encoder_runme {
|
||||
static { System.loadLibrary("rename_pcre_encoder"); }
|
||||
|
||||
public static void main(String argv[])
|
||||
{
|
||||
SomeWidget w = new SomeWidget();
|
||||
w.putBorderWidth(17);
|
||||
if ( w.getBorderWidth() != 17 )
|
||||
throw new RuntimeException(String.format("Border with should be 17, not %d",
|
||||
w.getBorderWidth()));
|
||||
}
|
||||
}
|
||||
26
Examples/test-suite/java/rename_pcre_enum_runme.java
Normal file
26
Examples/test-suite/java/rename_pcre_enum_runme.java
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import rename_pcre_enum.*;
|
||||
|
||||
public class rename_pcre_enum_runme {
|
||||
static { System.loadLibrary("rename_pcre_enum"); }
|
||||
|
||||
public static void main(String argv[])
|
||||
{
|
||||
Foo foo = Foo.First;
|
||||
if ( foo == Foo.Second )
|
||||
throw new RuntimeException("Enum values should be different");
|
||||
|
||||
// Check that Foo_Max enum element was ignored.
|
||||
int numFooEnumElements = Foo.values().length;
|
||||
if ( numFooEnumElements != 2 )
|
||||
throw new RuntimeException(String.format("Enum should have 2 elements, not %d",
|
||||
numFooEnumElements));
|
||||
|
||||
BoundaryCondition bc = BoundaryCondition.MaxMax;
|
||||
if ( bc.ordinal() != 2 )
|
||||
throw new RuntimeException("Wrong enum value");
|
||||
|
||||
Colour c = Colour.red;
|
||||
if ( c == Colour.blue )
|
||||
throw new RuntimeException("Enum values should be different");
|
||||
}
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ public class rname_runme {
|
|||
throw new RuntimeException("base.newname");
|
||||
|
||||
RenamedDerived derived = new RenamedDerived();
|
||||
derived.func(base, base, base);
|
||||
derived.Xfunc(base, base, base);
|
||||
if (!derived.newname(10.0).equals("Derived"))
|
||||
throw new RuntimeException("derived.newname");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,99 @@
|
|||
import smart_pointer_const_overload.*;
|
||||
|
||||
public class smart_pointer_const_overload_runme {
|
||||
static int CONST_ACCESS = 1;
|
||||
static int MUTABLE_ACCESS = 2;
|
||||
|
||||
static {
|
||||
System.loadLibrary("smart_pointer_const_overload");
|
||||
}
|
||||
|
||||
public static void test(Bar b, Foo f) {
|
||||
Assert(f.getX() == 0);
|
||||
|
||||
// Test member variable get
|
||||
Assert(b.getX() == 0);
|
||||
Assert(f.getAccess() == CONST_ACCESS);
|
||||
|
||||
// Test member variable set
|
||||
b.setX(1);
|
||||
Assert(f.getX() == 1);
|
||||
Assert(f.getAccess() == MUTABLE_ACCESS);
|
||||
|
||||
// Test const method
|
||||
Assert(b.getx() == 1);
|
||||
Assert(f.getAccess() == CONST_ACCESS);
|
||||
|
||||
// Test mutable method
|
||||
b.setx(2);
|
||||
|
||||
Assert(f.getX() == 2);
|
||||
Assert(f.getAccess() == MUTABLE_ACCESS);
|
||||
|
||||
// Test extended const method
|
||||
Assert(b.getx2() == 2);
|
||||
Assert(f.getAccess() == CONST_ACCESS);
|
||||
|
||||
// Test extended mutable method
|
||||
b.setx2(3);
|
||||
|
||||
Assert(f.getX() == 3);
|
||||
Assert(f.getAccess() == MUTABLE_ACCESS);
|
||||
|
||||
// Test static method
|
||||
b.stat();
|
||||
|
||||
Assert(f.getAccess() == CONST_ACCESS);
|
||||
|
||||
// Test const member
|
||||
f.setAccess(MUTABLE_ACCESS);
|
||||
|
||||
Assert(b.getY() == 0);
|
||||
Assert(f.getAccess() == CONST_ACCESS);
|
||||
|
||||
// Test get through mutable pointer to const member
|
||||
f.setAccess(MUTABLE_ACCESS);
|
||||
|
||||
Assert(smart_pointer_const_overload.get_int(b.getYp()) == 0);
|
||||
Assert(f.getAccess() == CONST_ACCESS);
|
||||
|
||||
// Test get through const pointer to mutable member
|
||||
f.setX(4);
|
||||
f.setAccess(MUTABLE_ACCESS);
|
||||
|
||||
Assert(smart_pointer_const_overload.get_int(b.getXp()) == 4);
|
||||
Assert(f.getAccess() == CONST_ACCESS);
|
||||
|
||||
// Test set through const pointer to mutable member
|
||||
f.setAccess(MUTABLE_ACCESS);
|
||||
smart_pointer_const_overload.set_int(b.getXp(), 5);
|
||||
|
||||
Assert(f.getX() == 5);
|
||||
Assert(f.getAccess() == CONST_ACCESS);
|
||||
|
||||
// Test set pointer to const member
|
||||
b.setYp(smart_pointer_const_overload.new_int(6));
|
||||
|
||||
Assert(f.getY() == 0);
|
||||
Assert(smart_pointer_const_overload.get_int(f.getYp()) == 6);
|
||||
Assert(f.getAccess() == MUTABLE_ACCESS);
|
||||
|
||||
smart_pointer_const_overload.delete_int(f.getYp());
|
||||
}
|
||||
|
||||
public static void main(String argv[]) {
|
||||
Foo f = new Foo();
|
||||
Bar b = new Bar(f);
|
||||
|
||||
//Foo f2 = new Foo();
|
||||
//Bar b2 = new Bar2(f2);
|
||||
|
||||
test(b, f);
|
||||
//test(b2, f2);
|
||||
}
|
||||
|
||||
public static void Assert(boolean b) {
|
||||
if (!b)
|
||||
throw new RuntimeException("Assertion failed");
|
||||
}
|
||||
}
|
||||
|
|
@ -15,13 +15,13 @@ public class special_variables_runme {
|
|||
public static void main(String argv[])
|
||||
{
|
||||
verify(special_variables.ExceptionVars(1.0, 2.0),
|
||||
"result = Space::exceptionvars(arg1,arg2); Space::exceptionvars ExceptionVars Java_special_1variables_special_1variablesJNI_ExceptionVars");
|
||||
"result = Space::exceptionvars(arg1,arg2); Space::exceptionvars ExceptionVars Java_special_1variables_special_1variablesJNI_ExceptionVars ");
|
||||
|
||||
verify(special_variables.overloadedmethod(),
|
||||
"result = Space::overloadedmethod(); Space::overloadedmethod overloadedmethod __SWIG_1 Java_special_1variables_special_1variablesJNI_overloadedmethod_1_1SWIG_11");
|
||||
"result = Space::overloadedmethod(); Space::overloadedmethod overloadedmethod __SWIG_1 Java_special_1variables_special_1variablesJNI_overloadedmethod_1_1SWIG_11 ");
|
||||
|
||||
verify(special_variables.overloadedmethod(10.0),
|
||||
"result = Space::overloadedmethod(arg1); Space::overloadedmethod overloadedmethod __SWIG_0 Java_special_1variables_special_1variablesJNI_overloadedmethod_1_1SWIG_10");
|
||||
"result = Space::overloadedmethod(arg1); Space::overloadedmethod overloadedmethod __SWIG_0 Java_special_1variables_special_1variablesJNI_overloadedmethod_1_1SWIG_10 ");
|
||||
|
||||
ABC a = new ABC(0, 0.0);
|
||||
verify(special_variables.getDeclaration(), "SpaceNamespace::ABC::ABC(int,double) SpaceNamespace::ABC::ABC(int,double)");
|
||||
|
|
|
|||
|
|
@ -17,8 +17,11 @@ public class template_default_class_parms_runme {
|
|||
{
|
||||
DefaultBar bar = new DefaultBar(20.0, new SomeType(), 10);
|
||||
double d = bar.getCType();
|
||||
bar.setCType(d);
|
||||
SomeType s = bar.getDType();
|
||||
bar.setDType(s);
|
||||
int i = bar.getEType();
|
||||
bar.setEType(i);
|
||||
d = bar.method(d, s, i);
|
||||
}
|
||||
{
|
||||
|
|
@ -29,13 +32,17 @@ public class template_default_class_parms_runme {
|
|||
{
|
||||
BarAnotherTypeBool bar = new BarAnotherTypeBool(new AnotherType(), true, 10);
|
||||
AnotherType a = bar.getCType();
|
||||
bar.setCType(a);
|
||||
boolean b = bar.getDType();
|
||||
bar.setDType(b);
|
||||
int i = bar.getEType();
|
||||
bar.setEType(i);
|
||||
a = bar.method(a, b, i);
|
||||
}
|
||||
{
|
||||
FooAnotherType foo = new FooAnotherType(new AnotherType());
|
||||
AnotherType a = foo.getTType();
|
||||
foo.setTType(a);
|
||||
a = foo.method(a);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
|
||||
|
||||
import template_default_class_parms_typedef.*;
|
||||
|
||||
public class template_default_class_parms_typedef_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("template_default_class_parms_typedef");
|
||||
} 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[]) {
|
||||
{
|
||||
DefaultBar bar = new DefaultBar(20.0, new SomeType(), 10);
|
||||
double d = bar.getCType();
|
||||
bar.setCType(d);
|
||||
SomeType s = bar.getDType();
|
||||
bar.setDType(s);
|
||||
int i = bar.getEType();
|
||||
bar.setEType(i);
|
||||
d = bar.method(d, s, i);
|
||||
d = bar.method_1(d, s, i);
|
||||
d = bar.method_2(d, s, i);
|
||||
d = bar.method_3(d, s, i);
|
||||
|
||||
bar = new DefaultBar(true, 20.0, new SomeType(), 10);
|
||||
bar = new DefaultBar(true, true, 20.0, new SomeType(), 10);
|
||||
bar = new DefaultBar(true, true, true, 20.0, new SomeType(), 10);
|
||||
}
|
||||
{
|
||||
DefaultFoo foo = new DefaultFoo(new SomeType());
|
||||
SomeType s = foo.getTType();
|
||||
s = foo.method(s);
|
||||
s = foo.method_A(s);
|
||||
s = foo.method_B(s);
|
||||
s = foo.method_C(s);
|
||||
|
||||
foo = new DefaultFoo(new SomeType(), new SomeType());
|
||||
foo = new DefaultFoo(new SomeType(), new SomeType(), new SomeType());
|
||||
foo = new DefaultFoo(new SomeType(), new SomeType(), new SomeType(), new SomeType());
|
||||
}
|
||||
{
|
||||
BarAnotherTypeBool bar = new BarAnotherTypeBool(new AnotherType(), true, 10);
|
||||
AnotherType a = bar.getCType();
|
||||
bar.setCType(a);
|
||||
boolean b = bar.getDType();
|
||||
bar.setDType(b);
|
||||
int i = bar.getEType();
|
||||
bar.setEType(i);
|
||||
|
||||
a = bar.method(a, b, i);
|
||||
a = bar.method_1(a, b, i);
|
||||
a = bar.method_2(a, b, i);
|
||||
a = bar.method_3(a, b, i);
|
||||
|
||||
bar = new BarAnotherTypeBool(true, new AnotherType(), true, 10);
|
||||
bar = new BarAnotherTypeBool(true, true, new AnotherType(), true, 10);
|
||||
bar = new BarAnotherTypeBool(true, true, true, new AnotherType(), true, 10);
|
||||
}
|
||||
{
|
||||
FooAnotherType foo = new FooAnotherType(new AnotherType());
|
||||
AnotherType a = foo.getTType();
|
||||
foo.setTType(a);
|
||||
a = foo.method(a);
|
||||
a = foo.method_A(a);
|
||||
a = foo.method_B(a);
|
||||
a = foo.method_C(a);
|
||||
|
||||
foo = new FooAnotherType(new AnotherType(), new AnotherType());
|
||||
foo = new FooAnotherType(new AnotherType(), new AnotherType(), new AnotherType());
|
||||
foo = new FooAnotherType(new AnotherType(), new AnotherType(), new AnotherType(), new AnotherType());
|
||||
}
|
||||
{
|
||||
UsesBarDouble u = new UsesBarDouble();
|
||||
u.use_A(10.1, new SomeType(), 10);
|
||||
u.use_B(10.1, new SomeType(), 10);
|
||||
u.use_C(10.1, new SomeType(), 10);
|
||||
u.use_D(10.1, new SomeType(), 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
import template_namespace_forward_declaration.*;
|
||||
|
||||
public class template_namespace_forward_declaration_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("template_namespace_forward_declaration");
|
||||
} 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[]) {
|
||||
XXXInt xxx = new XXXInt();
|
||||
template_namespace_forward_declaration.testXXX1(xxx);
|
||||
template_namespace_forward_declaration.testXXX2(xxx);
|
||||
template_namespace_forward_declaration.testXXX3(xxx);
|
||||
YYYInt yyy = new YYYInt();
|
||||
template_namespace_forward_declaration.testYYY1(yyy);
|
||||
template_namespace_forward_declaration.testYYY2(yyy);
|
||||
template_namespace_forward_declaration.testYYY3(yyy);
|
||||
}
|
||||
}
|
||||
|
||||
24
Examples/test-suite/java/template_typedef_inherit_runme.java
Normal file
24
Examples/test-suite/java/template_typedef_inherit_runme.java
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
|
||||
import template_typedef_inherit.*;
|
||||
|
||||
public class template_typedef_inherit_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("template_typedef_inherit");
|
||||
} 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[]) {
|
||||
DescriptionImplementationTypedCollectionInterfaceObject d = new DescriptionImplementationTypedCollectionInterfaceObject();
|
||||
d.add("a string");
|
||||
|
||||
StringPersistentCollection s = new StringPersistentCollection();
|
||||
s.add("a string");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
import template_using_directive_and_declaration_forward.*;
|
||||
|
||||
public class template_using_directive_and_declaration_forward_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("template_using_directive_and_declaration_forward");
|
||||
} 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[])
|
||||
{
|
||||
template_using_directive_and_declaration_forward.useit1(new Thing1Int());
|
||||
template_using_directive_and_declaration_forward.useit1a(new Thing1Int());
|
||||
template_using_directive_and_declaration_forward.useit1b(new Thing1Int());
|
||||
template_using_directive_and_declaration_forward.useit1c(new Thing1Int());
|
||||
|
||||
//BROKEN template_using_directive_and_declaration_forward.useit2(new Thing2Int());
|
||||
template_using_directive_and_declaration_forward.useit2a(new Thing2Int());
|
||||
template_using_directive_and_declaration_forward.useit2b(new Thing2Int());
|
||||
template_using_directive_and_declaration_forward.useit2c(new Thing2Int());
|
||||
template_using_directive_and_declaration_forward.useit2d(new Thing2Int());
|
||||
|
||||
//BROKEN template_using_directive_and_declaration_forward.useit3(new Thing3Int());
|
||||
template_using_directive_and_declaration_forward.useit3a(new Thing3Int());
|
||||
template_using_directive_and_declaration_forward.useit3b(new Thing3Int());
|
||||
template_using_directive_and_declaration_forward.useit3c(new Thing3Int());
|
||||
template_using_directive_and_declaration_forward.useit3d(new Thing3Int());
|
||||
|
||||
//BROKEN template_using_directive_and_declaration_forward.useit4(new Thing4Int());
|
||||
template_using_directive_and_declaration_forward.useit4a(new Thing4Int());
|
||||
template_using_directive_and_declaration_forward.useit4b(new Thing4Int());
|
||||
template_using_directive_and_declaration_forward.useit4c(new Thing4Int());
|
||||
template_using_directive_and_declaration_forward.useit4d(new Thing4Int());
|
||||
|
||||
//BROKEN template_using_directive_and_declaration_forward.useit5(new Thing5Int());
|
||||
template_using_directive_and_declaration_forward.useit5a(new Thing5Int());
|
||||
template_using_directive_and_declaration_forward.useit5b(new Thing5Int());
|
||||
template_using_directive_and_declaration_forward.useit5c(new Thing5Int());
|
||||
template_using_directive_and_declaration_forward.useit5d(new Thing5Int());
|
||||
|
||||
|
||||
//BROKEN template_using_directive_and_declaration_forward.useit7(new Thing7Int());
|
||||
template_using_directive_and_declaration_forward.useit7a(new Thing7Int());
|
||||
template_using_directive_and_declaration_forward.useit7b(new Thing7Int());
|
||||
template_using_directive_and_declaration_forward.useit7c(new Thing7Int());
|
||||
template_using_directive_and_declaration_forward.useit7d(new Thing7Int());
|
||||
}
|
||||
}
|
||||
19
Examples/test-suite/java/typemap_arrays_runme.java
Normal file
19
Examples/test-suite/java/typemap_arrays_runme.java
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import typemap_arrays.*;
|
||||
|
||||
public class typemap_arrays_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("typemap_arrays");
|
||||
} 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[]) {
|
||||
if (typemap_arrays.sumA(null) != 60)
|
||||
throw new RuntimeException("Sum is wrong");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
import using_directive_and_declaration_forward.*;
|
||||
|
||||
public class using_directive_and_declaration_forward_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("using_directive_and_declaration_forward");
|
||||
} 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[])
|
||||
{
|
||||
using_directive_and_declaration_forward.useit1(new Thing1());
|
||||
using_directive_and_declaration_forward.useit1a(new Thing1());
|
||||
using_directive_and_declaration_forward.useit1b(new Thing1());
|
||||
using_directive_and_declaration_forward.useit1c(new Thing1());
|
||||
|
||||
using_directive_and_declaration_forward.useit2(new Thing2());
|
||||
using_directive_and_declaration_forward.useit2a(new Thing2());
|
||||
using_directive_and_declaration_forward.useit2b(new Thing2());
|
||||
using_directive_and_declaration_forward.useit2c(new Thing2());
|
||||
using_directive_and_declaration_forward.useit2d(new Thing2());
|
||||
|
||||
using_directive_and_declaration_forward.useit3(new Thing3());
|
||||
using_directive_and_declaration_forward.useit3a(new Thing3());
|
||||
using_directive_and_declaration_forward.useit3b(new Thing3());
|
||||
using_directive_and_declaration_forward.useit3c(new Thing3());
|
||||
using_directive_and_declaration_forward.useit3d(new Thing3());
|
||||
|
||||
using_directive_and_declaration_forward.useit4(new Thing4());
|
||||
using_directive_and_declaration_forward.useit4a(new Thing4());
|
||||
using_directive_and_declaration_forward.useit4b(new Thing4());
|
||||
using_directive_and_declaration_forward.useit4c(new Thing4());
|
||||
using_directive_and_declaration_forward.useit4d(new Thing4());
|
||||
|
||||
using_directive_and_declaration_forward.useit5(new Thing5());
|
||||
using_directive_and_declaration_forward.useit5a(new Thing5());
|
||||
using_directive_and_declaration_forward.useit5b(new Thing5());
|
||||
using_directive_and_declaration_forward.useit5c(new Thing5());
|
||||
using_directive_and_declaration_forward.useit5d(new Thing5());
|
||||
|
||||
|
||||
using_directive_and_declaration_forward.useit7(new Thing7());
|
||||
using_directive_and_declaration_forward.useit7a(new Thing7());
|
||||
using_directive_and_declaration_forward.useit7b(new Thing7());
|
||||
using_directive_and_declaration_forward.useit7c(new Thing7());
|
||||
using_directive_and_declaration_forward.useit7d(new Thing7());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
import using_directive_and_declaration.*;
|
||||
|
||||
public class using_directive_and_declaration_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("using_directive_and_declaration");
|
||||
} 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[])
|
||||
{
|
||||
using_directive_and_declaration.useit1(new Thing1());
|
||||
using_directive_and_declaration.useit2(new Thing2());
|
||||
using_directive_and_declaration.useit3(new Thing3());
|
||||
using_directive_and_declaration.useit4(new Thing4());
|
||||
using_directive_and_declaration.useit5(new Thing5());
|
||||
Thing6a t6a = new Thing6a();
|
||||
t6a.a();
|
||||
Thing6 t6b = new Thing6();
|
||||
t6b.b();
|
||||
using_directive_and_declaration.useit6(t6a, t6b);
|
||||
using_directive_and_declaration.useit7(new Thing7());
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,9 @@ public class wallkw_runme {
|
|||
throw new RuntimeException("delegate keyword fail");
|
||||
if (!wallkw._pass().equals("pass"))
|
||||
throw new RuntimeException("pass keyword fail");
|
||||
if (!wallkw.C_alias().equals("alias"))
|
||||
if (!wallkw._alias().equals("alias"))
|
||||
throw new RuntimeException("alias keyword fail");
|
||||
if (!wallkw.C_rescue().equals("rescue"))
|
||||
throw new RuntimeException("rescue keyword fail");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue