From 04196d1f8cf1a3e8095a8cd4d7f1e6dbaa323203 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 10 Jan 2015 11:40:20 +0000 Subject: Use bit_length. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_integer_comb.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ruby/test_integer_comb.rb b/test/ruby/test_integer_comb.rb index e00e7588fd..9018518334 100644 --- a/test/ruby/test_integer_comb.rb +++ b/test/ruby/test_integer_comb.rb @@ -300,7 +300,7 @@ class TestIntegerComb < Test::Unit::TestCase assert_equal(a, c >> b, "(#{a} << #{b}) >> #{b}") assert_equal(a * 2**b, c, "#{a} << #{b}") end - 0.upto(c.size*8+10) {|nth| + 0.upto(c.bit_length+10) {|nth| assert_equal(a[nth-b], c[nth], "(#{a} << #{b})[#{nth}]") } } @@ -317,7 +317,7 @@ class TestIntegerComb < Test::Unit::TestCase assert_equal(a, c << b, "(#{a} >> #{b}) << #{b}") assert_equal(a * 2**(-b), c, "#{a} >> #{b}") end - 0.upto(c.size*8+10) {|nth| + 0.upto(c.bit_length+10) {|nth| assert_equal(a[nth+b], c[nth], "(#{a} >> #{b})[#{nth}]") } } -- cgit v1.2.3