Change 20017 by [EMAIL PROTECTED] on 2003/07/05 17:47:47
Subject: [PATCH] fix for ext/threads/t/problems.t failures
From: Dave Mitchell <[EMAIL PROTECTED]>
Date: Sat, 5 Jul 2003 19:12:51 +0100
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/ext/threads/t/problems.t#3 edit
Differences ...
==== //depot/perl/ext/threads/t/problems.t#3 (text) ====
Index: perl/ext/threads/t/problems.t
--- perl/ext/threads/t/problems.t#2~19705~ Sat Jun 7 05:42:28 2003
+++ perl/ext/threads/t/problems.t Sat Jul 5 10:47:47 2003
@@ -9,11 +9,29 @@
}
}
-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 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;
-
-
-
-
-
-
-
End of Patch.