X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=blobdiff_plain;f=t%2F41-clone.t;h=2058cc58ed67c14cec7219ef5cb71f3ccad802f4;hp=1efd250bd13f6c8a0b59c6401256f70804bda238;hb=b1c264655ccc1eca4423e9dd9479855938bbac24;hpb=6f9e4d15e5b78907f2bc9abe93719ae0c35af4fa diff --git a/t/41-clone.t b/t/41-clone.t index 1efd250..2058cc5 100644 --- a/t/41-clone.t +++ b/t/41-clone.t @@ -102,7 +102,7 @@ sub try { } } - return; + return 1; } my $wiz_name = spawn_wiz VMG_OP_INFO_NAME; @@ -119,16 +119,21 @@ for my $dispell (1, 0) { $destroyed = 0; } + my $completed = 0; + my @threads = map spawn(\&try, $dispell, $wiz), 1 .. 2; - $_->join for @threads; + for my $thr (@threads) { + my $res = $thr->join; + $completed += $res if defined $res; + } { lock $c; - is $c, 2, "get triggered twice"; + is $c, $completed, "get triggered twice"; } { lock $destroyed; - is $destroyed, (1 - $dispell) * 2, 'destructors'; + is $destroyed, (1 - $dispell) * $completed, 'destructors'; } } }