Change 11797 by sky@sky-lab on 2001/08/31 11:28:17
Subject: Re: Problem in ext/Time/HiRest/HiRes.t
From: "John P. Linderman" <[EMAIL PROTECTED]>
Date: Fri, 31 Aug 2001 08:20:35 -0400
Message-Id: <[EMAIL PROTECTED]>
Fixes test 14 which could fail randomly in rare cases.
Affected files ...
... //depot/perl/ext/Time/HiRes/HiRes.t#3 edit
... //depot/perl/regcomp.c#229 edit
Differences ...
==== //depot/perl/ext/Time/HiRes/HiRes.t#3 (text) ====
Index: perl/ext/Time/HiRes/HiRes.t
--- perl/ext/Time/HiRes/HiRes.t.~1~ Fri Aug 31 05:45:06 2001
+++ perl/ext/Time/HiRes/HiRes.t Fri Aug 31 05:45:06 2001
@@ -133,10 +133,16 @@
if (!$have_time) {
skip 14
} else {
- my $t = time();
- my $tf = Time::HiRes::time();
- ok 14, (abs($tf - $t) <= 1),
- "time $t differs from Time::HiRes::time $tf";
+ my ($t1, $tf, $t2);
+ for my $i (1 .. 9) {
+ $t1 = time();
+ $tf = Time::HiRes::time();
+ $t2 = 1 + time();
+ last if (($t2 - $t1) <= 1);
+ }
+ ok 14, (($t1 <= $tf) && ($tf <= $t2)),
+ "Time::HiRes::time $tf not bracketed by $t1 - $t2";
+
}
unless (defined &Time::HiRes::gettimeofday
==== //depot/perl/regcomp.c#229 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c.~1~ Fri Aug 31 05:45:06 2001
+++ perl/regcomp.c Fri Aug 31 05:45:06 2001
@@ -4735,7 +4735,7 @@
SAVEVPTR(PL_reg_re); /* from regexec.c */
SAVEPPTR(PL_reg_ganch); /* from regexec.c */
SAVESPTR(PL_reg_sv); /* from regexec.c */
- SAVEI32(PL_reg_sv_utf8); /* from regexec.c */
+ SAVESPTR(PL_reg_sv_utf8); /* from regexec.c */
SAVEVPTR(PL_reg_magic); /* from regexec.c */
SAVEI32(PL_reg_oldpos); /* from regexec.c */
SAVEVPTR(PL_reg_oldcurpm); /* from regexec.c */
End of Patch.