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

@ -4,9 +4,14 @@ t = Test()
if t.strlen('hile') != 4:
print t.strlen('hile')
raise RuntimeError, "bad multi-arg typemap"
if t.ustrlen('hile') != 4:
print t.ustrlen('hile')
raise RuntimeError, "bad multi-arg typemap"
if t.strlen('hil\0') != 4:
raise RuntimeError, "bad multi-arg typemap"
if t.ustrlen('hil\0') != 4:
raise RuntimeError, "bad multi-arg typemap"
#
# creating a raw char*
@ -21,6 +26,8 @@ pchar_setitem(pc, 4, 0)
if t.strlen(pc) != 4:
raise RuntimeError, "bad multi-arg typemap"
if t.ustrlen(pc) != 4:
raise RuntimeError, "bad multi-arg typemap"
cvar.var_pchar = pc
if cvar.var_pchar != "hola":