X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F40-threads.t;h=0b16c6aeb44acc8e18a4ae81ef2b055acb7d57dd;hb=e8a50f8f820a7aa610721b06af9251468a635e6b;hp=6aade888c9082bb4bfc92868e16fef8fcdf5a697;hpb=146bea88eff25c0c068b82e0e2ddccc5055e6b73;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/40-threads.t b/t/40-threads.t index 6aade88..0b16c6a 100644 --- a/t/40-threads.t +++ b/t/40-threads.t @@ -33,7 +33,7 @@ if (VMG_THREADSAFE) { my $destroyed : shared = 0; sub try { - my ($sig, $dispell, $op_info) = @_; + my ($dispell, $sig, $op_info) = @_; my $tid = threads->tid(); my $c = 0; my $wiz = eval { @@ -41,9 +41,14 @@ sub try { sig => $sig, get => sub { ++$c; 0 }, set => sub { - my $name = $_[-1]; - $name = $name->name if $op_info == VMG_OP_INFO_OBJECT; - is $name, 'sassign', "opname for op_info $op_info in thread $tid is correct"; + my $op = $_[-1]; + if ($op_info == VMG_OP_INFO_OBJECT) { + is_deeply { class => ref($op), name => $op->name }, + { class => 'B::BINOP', name => 'sassign' }, + "op object in thread $tid is correct"; + } else { + is $op, 'sassign', "op name in thread $tid is correct"; + } 0 }, free => sub { ++$destroyed; 0 }, @@ -83,7 +88,7 @@ sub try { for my $dispell (1, 0) { for my $sig (undef, Variable::Magic::gensig()) { $destroyed = 0; - my @t = map { threads->create(\&try, $sig, $dispell, $_) } + my @t = map { threads->create(\&try, $dispell, $sig, $_) } (VMG_OP_INFO_NAME) x 2, (VMG_OP_INFO_OBJECT) x 2; $_->join for @t; is($destroyed, (1 - $dispell) * 4, 'destructors');