From 4516f623b8628e8b424197cf29c786172f23e1ad Mon Sep 17 00:00:00 2001 From: mame Date: Tue, 21 Jul 2009 14:51:17 +0000 Subject: * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@24228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_rand.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ruby/test_rand.rb') diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb index 7bfd96f355..140851d5ba 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 -- cgit v1.2.3