Fix #3475492 - iterating through std::vector wrappers of enumerations.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12916 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3340045d67
commit
50693941c6
13 changed files with 253 additions and 0 deletions
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");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue