diff options
author | Karl Williamson <public@khwilliamson.com> | 2010-09-09 18:06:22 -0600 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-09-25 00:47:00 -0700 |
commit | f3397f68aadcbcd597a7272af2d183071061cb63 (patch) | |
tree | 0c147b1f3da0db305f9de76c9c2ce612d09a79db /lib/charnames.t | |
parent | 73d9566fc50e22faa4e73bd2038ccdce8321e862 (diff) | |
download | perl-f3397f68aadcbcd597a7272af2d183071061cb63.tar.gz |
charnames.t: Don't call srand(undef)
srand(undef) is the same as srand(0). The code is trying to get random
seeds, not a fixed one.
Diffstat (limited to 'lib/charnames.t')
-rw-r--r-- | lib/charnames.t | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/charnames.t b/lib/charnames.t index eb7358c8e4..43f4857527 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -776,9 +776,15 @@ is("\N{U+1D0C5}", "\N{BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA VASIS}"); # For randomized tests below. my $seed; - $seed = $ENV{PERL_TEST_CHARNAMES_SEED} if - defined $ENV{PERL_TEST_CHARNAMES_SEED}; - $seed = srand($seed); + if (defined $ENV{PERL_TEST_CHARNAMES_SEED}) { + $seed = srand($ENV{PERL_TEST_CHARNAMES_SEED}); + if ($seed != $ENV{PERL_TEST_CHARNAMES_SEED}) { + die "srand returned '$seed' instead of '$ENV{PERL_TEST_CHARNAMES_SEED}'"; + }; + } + else { + $seed = srand; + } # We will look at the data grouped in "blocks" of the following # size. |