Make (char*, size_t) typemap usable for strings of other types in Java.

Notably it now works for "unsigned char*" strings.

Add a test to check that it now works in Java and also showing that it already
worked for the other languages with support for this typemap.
This commit is contained in:
Vadim Zeitlin 2015-08-06 00:10:51 +02:00
commit a1bddd56eb
7 changed files with 37 additions and 3 deletions

View file

@ -5,10 +5,17 @@ if (t.strlen('hile') != 4) {
print(t.strlen('hile'));
throw("bad multi-arg typemap 1");
}
if (t.ustrlen('hile') != 4) {
print(t.ustrlen('hile'));
throw("bad multi-arg typemap 1");
}
if (t.strlen('hil\0') != 4) {
throw("bad multi-arg typemap 2");
}
if (t.ustrlen('hil\0') != 4) {
throw("bad multi-arg typemap 2");
}
/*
* creating a raw char*
@ -24,6 +31,9 @@ char_binary.pchar_setitem(pc, 4, 0);
if (t.strlen(pc) != 4) {
throw("bad multi-arg typemap (3)");
}
if (t.ustrlen(pc) != 4) {
throw("bad multi-arg typemap (3)");
}
char_binary.var_pchar = pc;
if (char_binary.var_pchar != "hola") {