Added some missing multi-argument typemaps: (char *STRING, size_t LENGTH) and (char *STRING, int LENGTH) - Java patch is from Volker Grabsch. Elements of the primitive_types.i testcase for this moved into char_binary.i. Documentation for this enhanced.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12393 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9adb494558
commit
ef865e06d5
15 changed files with 194 additions and 37 deletions
32
Examples/test-suite/perl5/char_binary_runme.pl
Executable file
32
Examples/test-suite/perl5/char_binary_runme.pl
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 7;
|
||||
BEGIN { use_ok('char_binary') }
|
||||
require_ok('char_binary');
|
||||
|
||||
my $t = char_binary::Test->new();
|
||||
|
||||
is($t->strlen('hile'), 4, "string typemap");
|
||||
|
||||
is($t->strlen("hil\0"), 4, "string typemap");
|
||||
|
||||
#
|
||||
# creating a raw char*
|
||||
#
|
||||
my $pc = char_binary::new_pchar(5);
|
||||
char_binary::pchar_setitem($pc, 0, 'h');
|
||||
char_binary::pchar_setitem($pc, 1, 'o');
|
||||
char_binary::pchar_setitem($pc, 2, 'l');
|
||||
char_binary::pchar_setitem($pc, 3, 'a');
|
||||
char_binary::pchar_setitem($pc, 4, 0);
|
||||
|
||||
|
||||
is($t->strlen($pc), 4, "string typemap");
|
||||
|
||||
$char_binary::var_pchar = $pc;
|
||||
is($char_binary::var_pchar, "hola", "pointer case");
|
||||
|
||||
$char_binary::var_namet = $pc;
|
||||
is($char_binary::var_namet, "hola", "pointer case");
|
||||
|
||||
char_binary::delete_pchar($pc);
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 54;
|
||||
use Test::More tests => 51;
|
||||
BEGIN { use_ok('primitive_types') }
|
||||
require_ok('primitive_types');
|
||||
|
||||
|
|
@ -179,11 +179,6 @@ $t->{var_namet} = 'hol';
|
|||
is($t->{var_namet}, 'hol', "namet");
|
||||
|
||||
|
||||
is($t->strlen('hile'), 4, "string typemap");
|
||||
|
||||
is($t->strlen("hil\0"), 4, "string typemap");
|
||||
|
||||
|
||||
$primitive_types::var_char = "\0";
|
||||
is($primitive_types::var_char, "\0", "char '0' case");
|
||||
|
||||
|
|
@ -220,8 +215,6 @@ primitive_types::pchar_setitem($pc, 3, 'a');
|
|||
primitive_types::pchar_setitem($pc, 4, 0);
|
||||
|
||||
|
||||
is($t->strlen($pc), 4, "string typemap");
|
||||
|
||||
$primitive_types::var_pchar = $pc;
|
||||
is($primitive_types::var_pchar, "hola", "pointer case");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue