Change 33023 by [EMAIL PROTECTED] on 2008/01/21 11:48:22
Remove hardcoded cop.h constants from APItest.pm :-(
Add G_WANT. Make call.t use G_WANT.
Affected files ...
... //depot/perl/ext/XS/APItest/APItest.pm#21 edit
... //depot/perl/ext/XS/APItest/Makefile.PL#6 edit
... //depot/perl/ext/XS/APItest/t/call.t#4 edit
Differences ...
==== //depot/perl/ext/XS/APItest/APItest.pm#21 (text) ====
Index: perl/ext/XS/APItest/APItest.pm
--- perl/ext/XS/APItest/APItest.pm#20~32699~ 2007-12-22 03:28:02.000000000
-0800
+++ perl/ext/XS/APItest/APItest.pm 2008-01-21 03:48:22.000000000 -0800
@@ -18,24 +18,13 @@
mxpushp mxpushn mxpushi mxpushu
call_sv call_pv call_method eval_sv eval_pv require_pv
G_SCALAR G_ARRAY G_VOID G_DISCARD G_EVAL G_NOARGS
- G_KEEPERR G_NODEBUG G_METHOD
+ G_KEEPERR G_NODEBUG G_METHOD G_WANT
apitest_exception mycroak strtab
my_cxt_getint my_cxt_getsv my_cxt_setint my_cxt_setsv
sv_setsv_cow_hashkey_core sv_setsv_cow_hashkey_notcore
);
-# from cop.h
-sub G_SCALAR() { 0 }
-sub G_ARRAY() { 1 }
-sub G_VOID() { 128 }
-sub G_DISCARD() { 2 }
-sub G_EVAL() { 4 }
-sub G_NOARGS() { 8 }
-sub G_KEEPERR() { 16 }
-sub G_NODEBUG() { 32 }
-sub G_METHOD() { 64 }
-
-our $VERSION = '0.12';
+our $VERSION = '0.13';
use vars '$WARNINGS_ON_BOOTSTRAP';
use vars map "\$${_}_called_PP", qw(BEGIN UNITCHECK CHECK INIT END);
==== //depot/perl/ext/XS/APItest/Makefile.PL#6 (text) ====
Index: perl/ext/XS/APItest/Makefile.PL
--- perl/ext/XS/APItest/Makefile.PL#5~31905~ 2007-09-19 03:53:01.000000000
-0700
+++ perl/ext/XS/APItest/Makefile.PL 2008-01-21 03:48:22.000000000 -0800
@@ -24,8 +24,11 @@
WriteConstants(
PROXYSUBS => 1,
NAME => 'XS::APItest',
- NAMES => [qw(HV_DELETE HV_DISABLE_UVAR_XKEY G_DISCARD HV_FETCH_ISSTORE
- HV_FETCH_ISEXISTS HV_FETCH_LVALUE HV_FETCH_JUST_SV)],
-);
+ NAMES => [qw(HV_DELETE HV_DISABLE_UVAR_XKEY HV_FETCH_ISSTORE
+ HV_FETCH_ISEXISTS HV_FETCH_LVALUE HV_FETCH_JUST_SV
+ G_SCALAR G_ARRAY G_VOID G_DISCARD G_EVAL G_NOARGS
+ G_KEEPERR G_NODEBUG G_METHOD G_FAKINGEVAL),
+ {name=>"G_WANT", default=>["IV", "G_ARRAY|G_VOID"]}],
+ );
sub MY::install { "install ::\n" };
==== //depot/perl/ext/XS/APItest/t/call.t#4 (text) ====
Index: perl/ext/XS/APItest/t/call.t
--- perl/ext/XS/APItest/t/call.t#3~23210~ 2004-08-09 12:58:35.000000000
-0700
+++ perl/ext/XS/APItest/t/call.t 2008-01-21 03:48:22.000000000 -0800
@@ -90,31 +90,33 @@
ok(eq_array( [ call_method('meth', $flags, $obj, @$args) ], $expected),
"$description call_method('meth')");
+ my $returnval = ((($flags & G_WANT) == G_ARRAY) || ($flags & G_DISCARD))
+ ? [0] : [ undef, 1 ];
for my $keep (0, G_KEEPERR) {
my $desc = $description . ($keep ? ' G_KEEPERR' : '');
my $exp_err = $keep ? "before\n\t(in cleanup) its_dead_jim\n"
: "its_dead_jim\n";
$@ = "before\n";
ok(eq_array( [ call_sv('d', $flags|G_EVAL|$keep, @$args) ],
- $flags & (G_ARRAY|G_DISCARD) ? [0] : [ undef, 1 ]),
+ $returnval),
"$desc G_EVAL call_sv('d')");
is($@, $exp_err, "$desc G_EVAL call_sv('d') - \$@");
$@ = "before\n";
ok(eq_array( [ call_pv('d', $flags|G_EVAL|$keep, @$args) ],
- $flags & (G_ARRAY|G_DISCARD) ? [0] : [ undef, 1 ]),
+ $returnval),
"$desc G_EVAL call_pv('d')");
is($@, $exp_err, "$desc G_EVAL call_pv('d') - \$@");
$@ = "before\n";
ok(eq_array( [ eval_sv('d()', $flags|$keep) ],
- $flags & (G_ARRAY|G_DISCARD) ? [0] : [ undef, 1 ]),
+ $returnval),
"$desc eval_sv('d()')");
is($@, $exp_err, "$desc eval_sv('d()') - \$@");
$@ = "before\n";
ok(eq_array( [ call_method('d', $flags|G_EVAL|$keep, $obj, @$args) ],
- $flags & (G_ARRAY|G_DISCARD) ? [0] : [ undef, 1 ]),
+ $returnval),
"$desc G_EVAL call_method('d')");
is($@, $exp_err, "$desc G_EVAL call_method('d') - \$@");
}
@@ -138,7 +140,7 @@
[ "its_dead_jim\n" ]), "$description eval { call_pv('d') }");
ok(eq_array( [ eval { eval_sv('d', $flags), $@ }, $@ ],
- [ ($flags & (G_ARRAY|G_DISCARD)) ? (0) : (undef, 1),
+ [ @$returnval,
"its_dead_jim\n", '' ]),
"$description eval { eval_sv('d') }");
End of Patch.