Fix seg fault when using a named template instantiation using %template(name) within a class

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11711 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2009-10-23 05:41:33 +00:00
commit 678abc58fb
6 changed files with 60 additions and 0 deletions

View file

@ -0,0 +1,27 @@
import template_nested_typemaps.*;
public class template_nested_typemaps_runme {
static {
try {
System.loadLibrary("template_nested_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[]) {
BreezeString b = new BreezeString();
{
int v = 88;
short vTypemap = -99;
if (b.methodInt1(v) != v) throw new RuntimeException("failed");
if (b.methodInt2(v) != vTypemap) throw new RuntimeException("failed");
if (template_nested_typemaps.globalInt1(v) != v) throw new RuntimeException("failed");
if (template_nested_typemaps.globalInt2(v) != v) throw new RuntimeException("failed");
}
}
}