Skip to content

Commit

Permalink
Fix line number reporting in extend_vtable_output_is and add a failin…
Browse files Browse the repository at this point in the history
…g test for Parrot_PMC_cmp_pmc
  • Loading branch information
leto committed Feb 20, 2011
1 parent 4783bdf commit a8a97d0
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion t/src/extend_vtable.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use File::Spec::Functions;

plan skip_all => 'src/parrot_config.o does not exist' unless -e catfile(qw/src parrot_config.o/);

plan tests => 59;
plan tests => 60;

=head1 NAME
Expand Down Expand Up @@ -91,6 +91,7 @@ CODE
sub extend_vtable_output_is
{
my ($code, $expected_output, $msg, @opts) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
c_output_is(
$common . linedirective(__LINE__) . <<CODE,
void dotest(Parrot_Interp interp, void *unused)
Expand Down Expand Up @@ -889,6 +890,30 @@ CODE
Done!
OUTPUT

extend_vtable_output_is(<<'CODE', <<'OUTPUT', "Parrot_PMC_cmp_pmc" );
Parrot_PMC_set_integer_native(interp, pmc, 42);
Parrot_PMC_set_integer_native(interp, pmc2, 17);
pmc = Parrot_PMC_cmp_pmc(interp, pmc, pmc2);
Parrot_printf(interp,"%d\n", integer );
Parrot_PMC_set_integer_native(interp, pmc, 17);
Parrot_PMC_set_integer_native(interp, pmc2, 42);
pmc = Parrot_PMC_cmp_pmc(interp, pmc, pmc2);
Parrot_printf(interp,"%d\n", integer );
Parrot_PMC_set_integer_native(interp, pmc, 42);
pmc = Parrot_PMC_cmp_pmc(interp, pmc, pmc2);
Parrot_printf(interp,"%d\n", integer );
CODE
1
-1
0
Done!
OUTPUT

extend_vtable_output_is(<<'CODE', <<'OUTPUT', "Parrot_PMC_cmp_num" );
Parrot_PMC_set_integer_native(interp, pmc, 42);
Parrot_PMC_set_integer_native(interp, pmc2, 17);
Expand Down

0 comments on commit a8a97d0

Please sign in to comment.