aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_integer_comb.rb4
1 files 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}]")
}
}