summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn P. Linderman <jpl@research.att.com>2001-08-31 04:20:35 -0400
committerArtur Bergman <sky@nanisky.com>2001-08-31 11:28:17 +0000
commit18f4c9854757cade73b2543c4c6e4eb30415135f (patch)
treee534e9b54bb4f87074d21771333d1b3984df95b9
parent576354c71aa85e1b1a14f6c95d6138cb71764d1b (diff)
downloadperl-18f4c9854757cade73b2543c4c6e4eb30415135f.tar.gz
Re: Problem in ext/Time/HiRest/HiRes.t
Message-Id: <200108311220.IAA54125@raptor.research.att.com> Fixes test 14 which could fail randomly in rare cases. p4raw-id: //depot/perl@11797
-rw-r--r--ext/Time/HiRes/HiRes.t14
-rw-r--r--regcomp.c2
2 files changed, 11 insertions, 5 deletions
diff --git a/ext/Time/HiRes/HiRes.t b/ext/Time/HiRes/HiRes.t
index 95f1a0814d..be462e6ec1 100644
--- a/ext/Time/HiRes/HiRes.t
+++ b/ext/Time/HiRes/HiRes.t
@@ -133,10 +133,16 @@ else {
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
diff --git a/regcomp.c b/regcomp.c
index 9877658a0e..e5afc90e14 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4735,7 +4735,7 @@ Perl_save_re_context(pTHX)
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 */