several testcases for perl
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10403 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ef7c0cbbd2
commit
8b713d759d
53 changed files with 2037 additions and 486 deletions
|
|
@ -1,11 +1,14 @@
|
|||
use li_cdata_carrays;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 4;
|
||||
BEGIN { use_ok('li_cdata_carrays') }
|
||||
require_ok('li_cdata_carrays');
|
||||
|
||||
$a = li_cdata_carrays::intArray->new(5);
|
||||
my $ia = li_cdata_carrays::intArray->new(5);
|
||||
for (0..4) {
|
||||
$a->setitem($_, $_**2);
|
||||
}
|
||||
$x = pack q{I5}, map $_**2, (0..4);
|
||||
$y = li_cdata_carrays::cdata_int($a->cast, 5);
|
||||
if ( $x ne $y ) {
|
||||
die "$x vs $y";
|
||||
$ia->setitem($_, $_**2);
|
||||
}
|
||||
ok(1, "setitems");
|
||||
my $x = pack q{I5}, map $_**2, (0..4);
|
||||
my $y = li_cdata_carrays::cdata_int($ia->cast, 5);
|
||||
is($x, $y, "carrays");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue