varargs runtime test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4578 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
346e766e31
commit
b39ab0aa29
3 changed files with 57 additions and 4 deletions
28
Examples/test-suite/java/varargs_runme.java
Normal file
28
Examples/test-suite/java/varargs_runme.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// varargs test
|
||||
|
||||
import varargs.*;
|
||||
|
||||
public class varargs_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("varargs");
|
||||
} 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 (!varargs.test("Hello").equals("Hello"))
|
||||
throw new RuntimeException("Failed");
|
||||
|
||||
Foo f = new Foo("Greetings");
|
||||
if (!f.getStr().equals("Greetings"))
|
||||
throw new RuntimeException("Failed");
|
||||
|
||||
if (!f.test("Hello").equals("Hello"))
|
||||
throw new RuntimeException("Failed");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue