diff options
| author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-21 14:51:17 +0000 |
|---|---|---|
| committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-21 14:51:17 +0000 |
| commit | 05a47e886ad486894be6be779b867abfa283935a (patch) | |
| tree | 9e8835e2e2a3334b5e56072a35f6eddf3de732b6 /test/ruby | |
| parent | e580f7b2a612e1edaa502071189a46fce7749c69 (diff) | |
| download | ruby-05a47e886ad486894be6be779b867abfa283935a.tar.gz ruby-05a47e886ad486894be6be779b867abfa283935a.tar.xz ruby-05a47e886ad486894be6be779b867abfa283935a.zip | |
* random.c (rand_init): array length of random seed was broken, which
causes memory error with srand(2**1000000-1).
* test/ruby/test_rand.c: test for above.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_rand.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb index 7bfd96f35..140851d5b 100644 --- a/test/ruby/test_rand.rb +++ b/test/ruby/test_rand.rb @@ -164,4 +164,9 @@ class TestRand < Test::Unit::TestCase srand(0) assert_equal([1,4,2,5,3], [1,2,3,4,5].shuffle) end + + def test_big_seed + srand(2**1000000-1) + assert_equal(1143843490, rand(0x100000000)) + end end |
