From de2f7416d2deb4166d78638a41037cb550d64484 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 1 May 2016 15:16:17 +0000 Subject: envutil.rb defines Integer::{FIXNUM_MIN,FIXNUM_MAX}. * test/lib/envutil.rb: Define Integer::{FIXNUM_MIN,FIXNUM_MAX}. * test/ruby/test_bignum.rb: Use Integer::{FIXNUM_MIN,FIXNUM_MAX}. * test/ruby/test_bignum.rb: Ditto. * test/ruby/test_integer_comb.rb: Ditto. * test/ruby/test_marshal.rb: Ditto. * test/ruby/test_optimization.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_bignum.rb | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'test/ruby/test_bignum.rb') diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index b16832302e..f80828a7a1 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -2,16 +2,13 @@ require 'test/unit' class TestBignum < Test::Unit::TestCase - b = 2**64 - b *= b until Bignum === b + FIXNUM_MIN = Integer::FIXNUM_MIN + FIXNUM_MAX = Integer::FIXNUM_MAX - f = b - while Bignum === f-1 - f >>= 1 - end - BIGNUM_MIN = f - FIXNUM_MAX = f-1 + BIGNUM_MIN = FIXNUM_MAX + 1 + b = BIGNUM_MIN + f = BIGNUM_MIN n = 0 until f == 0 f >>= 1 -- cgit v1.2.3