nt') };
isnt $@, '', 'inline closure illegal';
eval { $ffi->type('(foo)->int') };
isnt $@, '', 'argument type closure illegal';
eval { $ffi->type('(int)->foo') };
isnt $@, '', 'r
->function(bogus => [] => 'void') };
isnt $@, '', 'function exception';
note "exception=$@";
eval { $ffi->attach(bogus => [] => 'void') };
isnt $@, '', 'attach exception';
note "e
->function(bogus => [] => 'void') };
isnt $@, '', 'function exception';
note "exception=$@";
eval { $ffi->attach(bogus => [] => 'void') };
isnt $@, '', 'attach exception';
note "e
isnt $@, '';
note "error = $@";
}
is($r2->three, 3);
is($r2->four, "four");
is($r2->myarray1, [1,2]);
{
local $@ = '';
eval { $r2->myarray1([3,4]) };
isnt
};
isnt $@, '';
note "error = $@";
}
is($r2->myarray1, [1,2]);
is($r2->opaque1, $r->opaque1);
{
local $@ = '';
eval { $r2->opaque1(undef) };
isnt $@, '';
ef,undef]) };
isnt $@, '';
note "error = $@";
}
is($r2->myarray2, $r->myarray2);
{
local $@ = '';
eval { $r2->myarray2(undef,undef) };
isnt $@, '';
note
isnt $@, '';
note "error = $@";
}
is($r2->three, 3);
is($r2->four, "four");
is($r2->myarray1, [1,2]);
{
local $@ = '';
eval { $r2->myarray1([3,4]) };
isnt
};
isnt $@, '';
note "error = $@";
}
is($r2->myarray1, [1,2]);
is($r2->opaque1, $r->opaque1);
{
local $@ = '';
eval { $r2->opaque1(undef) };
isnt $@, '';
ef,undef]) };
isnt $@, '';
note "error = $@";
}
is($r2->myarray2, $r->myarray2);
{
local $@ = '';
eval { $r2->myarray2(undef,undef) };
isnt $@, '';
note
$ffi = FFI::Platypus->new(lang => 'Foo');
$ffi->lib($libtest);
eval { $ffi->type('int') };
isnt $@, '', 'int is not an okay type';
note $@;
eval { $ffi->type('foo_t') };
is $@, '', 'foo_t
FFI::Platypus->new;
$ffi->lib($libtest);
$ffi->lang('Foo');
eval { $ffi->type('int') };
isnt $@, '', 'int is not an okay type';
note $@;
eval { $ffi->type('foo_t') };
is $@, '', 'foo_t
my $ffi = FFI::Platypus->new;
$ffi->lang('=MyLang::Roger');
eval { $ffi->type('int') };
isnt $@, '', 'int is not an okay type';
note $@;
is $ffi->sizeof('foo_t'), 4, 'sizeof foo_t = 4';
$ffi->lib($libtest);
eval { $ffi->type('int') };
isnt $@, '', 'int is not an okay type';
note $@;
eval { $ffi->type('foo_t') };
isnt $@, '', 'foo_t is not an okay type';
note $@;
eval
l { $ffi->type('((int)->int)->int') };
isnt "$@", "";
note "error = $@";
$ffi->type('(int)->int' => 'foo_t');
eval { $ffi->type('()->foo_t') };
isnt "$@", "";
note "error = $@";
};
done
typus::Record->import;
record_layout(
int => 'foo',
int => 'foo',
);
};
isnt $@, '', 'two members of the same name not allowed';
note $@ if $@;
};
do {
package
Foo4;
is $foo->get_value, 'my value', 'foo.get_value = my value';
eval { $foo->value("stuff") };
isnt $@, '', 'value is ro';
note $@ if $@;
$foo->set_value(undef);
is $foo->value, undef, 'foo
my $sv = B::svref_2object( \$str );
ok $sv->LEN >= $required, "buffer grew as expected";
isnt substr( $str, 0, length($orig) ), $orig, "original contents cleared";
is $sv->CUR, $required,
eval { $ffi->type('int') };
is $@, '', 'int is an okay type';
eval { $ffi->type('foo_t') };
isnt $@, '', 'foo_t is not an okay type';
note $@;
eval { $ffi->type('sint16') };
is $@, '', 'si
e.pm'};
if(eval q{ use Math::LongDouble; 1 })
{
is($pm, $INC{'Math/LongDouble.pm'});
isnt $pm, undef;
}
else
{
is($pm, undef);
is($INC{'Math/LongDouble.pm'}, undef);
}
};
e.pm'};
if(eval q{ use Math::LongDouble; 1 })
{
is($pm, $INC{'Math/LongDouble.pm'});
isnt $pm, undef;
}
else
{
is($pm, undef);
is($INC{'Math/LongDouble.pm'}, undef);
}
};
e.pm'};
if(eval q{ use Math::LongDouble; 1 })
{
is($pm, $INC{'Math/LongDouble.pm'});
isnt $pm, undef;
}
else
{
is($pm, undef);
is($INC{'Math/LongDouble.pm'}, undef);
}
};