| 1 |
Stop t/op/fork.t relying on rand(). (Closes: #317843)
|
| 2 |
|
| 3 |
[perl #53238]
|
| 4 |
blead change 33749
|
| 5 |
|
| 6 |
From: David Dick <perlbug-followup@perl.org>
|
| 7 |
Date: Tue, 22 Apr 2008 21:12:42 -0700
|
| 8 |
Subject: [PATCH] [perl #53238] Patch to stop t/op/fork.t relying on rand
|
| 9 |
From: David Dick (via RT) <perlbug-followup@perl.org>
|
| 10 |
Message-ID: <rt-3.6.HEAD-23612-1208949161-1511.53238-75-0@perl.org>
|
| 11 |
|
| 12 |
p4raw-id: //depot/perl@33749
|
| 13 |
---
|
| 14 |
t/op/fork.t | 8 +++-----
|
| 15 |
1 files changed, 3 insertions(+), 5 deletions(-)
|
| 16 |
|
| 17 |
diff --git a/t/op/fork.t b/t/op/fork.t
|
| 18 |
index 7318449..a19b260 100755
|
| 19 |
--- a/t/op/fork.t
|
| 20 |
+++ b/t/op/fork.t
|
| 21 |
@@ -445,16 +445,14 @@ pipe(RDR,WTR) or die $!;
|
| 22 |
my $pid = fork;
|
| 23 |
die "fork: $!" if !defined $pid;
|
| 24 |
if ($pid == 0) {
|
| 25 |
- my $rand_child = rand;
|
| 26 |
close RDR;
|
| 27 |
- print WTR $rand_child, "\n";
|
| 28 |
+ print WTR "STRING_FROM_CHILD\n";
|
| 29 |
close WTR;
|
| 30 |
} else {
|
| 31 |
- my $rand_parent = rand;
|
| 32 |
close WTR;
|
| 33 |
- chomp(my $rand_child = <RDR>);
|
| 34 |
+ chomp(my $string_from_child = <RDR>);
|
| 35 |
close RDR;
|
| 36 |
- print $rand_child ne $rand_parent, "\n";
|
| 37 |
+ print $string_from_child eq "STRING_FROM_CHILD", "\n";
|
| 38 |
}
|
| 39 |
EXPECT
|
| 40 |
1
|
| 41 |
--
|
| 42 |
1.5.6.5
|
| 43 |
|