From: Dave Mitchell Date: Sat, 5 Jul 2003 19:12:51 +0000 (+0100) Subject: fix for ext/threads/t/problems.t failures X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=997c206d9ff0f082ed5f00fa269645fbf464b557;p=p5sagit%2Fp5-mst-13.2.git fix for ext/threads/t/problems.t failures Message-ID: <20030705181251.GA14502@fdgroup.com> p4raw-id: //depot/perl@20017 --- diff --git a/ext/threads/t/problems.t b/ext/threads/t/problems.t index 7d0ee2f..f56a349 100644 --- a/ext/threads/t/problems.t +++ b/ext/threads/t/problems.t @@ -9,11 +9,29 @@ BEGIN { } } -use ExtUtils::testlib; +use warnings; use strict; use threads; use threads::shared; -use Test::More tests => 4; + +# Note that we can't use Test::More here, as we would need to +# call is() from within the DESTROY() function at global destruction time, +# and parts of Test::* may have already been freed by then + +print "1..4\n"; + +my $test : shared = 1; + +sub is($$$) { + my ($got, $want, $desc) = @_; + unless ($got eq $want) { + print "# EXPECTED: $want\n"; + print "# GOT: got\n"; + print "not "; + } + print "ok $test - $desc\n"; + $test++; +} # @@ -24,32 +42,21 @@ use Test::More tests => 4; ######################### $|++; -use Devel::Peek; - { - sub Foo::DESTROY { my $self = shift; my ($package, $file, $line) = caller; - is(threads->tid(),$self->{tid}, "In destroy it should be correct too" ) + is(threads->tid(),$self->{tid}, + "In destroy[$self->{tid}] it should be correct too" ) } my $foo; $foo = bless {tid => 0}, 'Foo'; my $bar = threads->create(sub { - is(threads->tid(),1, "And tid be 10 here"); + is(threads->tid(),1, "And tid be 1 here"); $foo->{tid} = 1; return $foo; })->join(); $bar->{tid} = 0; - - } 1; - - - - - - -