# reason that the diagnostic message might get the
# wrong value is that Config.pm is incorrect.)
#
- if ($max <= 0) { # Just in case...
+ if ($max <= 0 or $max >= (1 << $randbits)) { # Just in case...
print "not ok 1\n";
print "# This perl was compiled with randbits=$randbits\n";
print "# which is _way_ off. Or maybe your system rand is broken,\n";
print "# or your C compiler can't multiply, or maybe Martians\n";
print "# have taken over your computer. For starters, see about\n";
- print "# trying a better value for randbits.\n";
+ print "# trying a better value for randbits, probably smaller.\n";
# If that isn't the problem, we'll have
# to put d_martians into Config.pm
print "# Skipping remaining tests until randbits is fixed.\n";
{
srand; # These three lines are for test 7
my $time = time; # It's just faster to do them here.
- my $rand = rand;
+ my $rand = join ", ", rand, rand, rand;
# Hints for TEST 5
#
#
while ($time == time) { } # Wait for new second, just in case.
srand;
- if (rand == $rand) {
+ if ((join ", ", rand, rand, rand) eq $rand) {
print "not ok 7\n";
print "# srand without args isn't varying.\n";
} else {
my($pid, $first);
for (1..5) {
- $pid = open PERL, "./perl -e 'print rand'|";
+ my $PERL = (($^O eq 'VMS') ? "MCR $^X"
+ : ($^O eq 'MSWin32') ? '.\perl'
+ : './perl');
+ $pid = open PERL, qq[$PERL -e "print rand"|];
die "Couldn't pipe from perl: $!" unless defined $pid;
if (defined $first) {
if ($first ne <PERL>) {