summaryrefslogtreecommitdiff
path: root/test/-ext-
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-14 05:56:09 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-14 05:56:09 +0000
commited681d3a82591db3f4dd6e77c568f98b7d1d6216 (patch)
tree2b2c0611939a1a938ae58aa2ecd147cab9e1b6ad /test/-ext-
parent302220a8a53cb09713d2cfb05ac2decfc098030b (diff)
* bignum.c (rb_big2ull): fix 32bit platform breakage. we must
not assume sizeof(VALUE) == sizeof(LONG_LONG). * test/-ext-/num2int/test_num2int.rb (class TestNum2int): fix false assumption on 32bit platform. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-')
-rw-r--r--test/-ext-/num2int/test_num2int.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/-ext-/num2int/test_num2int.rb b/test/-ext-/num2int/test_num2int.rb
index 6cdfc4c52d5..381336e0c83 100644
--- a/test/-ext-/num2int/test_num2int.rb
+++ b/test/-ext-/num2int/test_num2int.rb
@@ -23,12 +23,10 @@ class TestNum2int < Test::Unit::TestCase
LONG_MIN = -9223372036854775808
ULONG_MAX = 18446744073709551615
end
- ULONG_HALF = ULONG_MAX - LONG_MAX
LLONG_MAX = 9223372036854775807
LLONG_MIN = -9223372036854775808
ULLONG_MAX = 18446744073709551615
- ULLONG_HALF = ULLONG_MAX - LLONG_MAX # 0x8000000000000000
FIXNUM_MAX = LONG_MAX/2
FIXNUM_MIN = LONG_MIN/2
@@ -151,10 +149,10 @@ class TestNum2int < Test::Unit::TestCase
assert_raise(RangeError) do
Num2int.print_num2ulong(ULONG_MAX+1)
end
- assert_output((ULONG_HALF+FIXNUM_MAX+1).to_s) do
+ assert_output((ULONG_MAX-FIXNUM_MAX).to_s) do
Num2int.print_num2ulong(FIXNUM_MIN)
end
- assert_output((ULONG_HALF+FIXNUM_MAX).to_s) do
+ assert_output((ULONG_MAX-FIXNUM_MAX-1).to_s) do
Num2int.print_num2ulong(FIXNUM_MIN-1)
end
assert_output(FIXNUM_MAX.to_s) do
@@ -211,10 +209,10 @@ class TestNum2int < Test::Unit::TestCase
assert_raise(RangeError) do
Num2int.print_num2ull(ULLONG_MAX+1)
end
- assert_output((ULLONG_HALF+FIXNUM_MAX+1).to_s) do
+ assert_output((ULLONG_MAX-FIXNUM_MAX).to_s) do
Num2int.print_num2ull(FIXNUM_MIN)
end
- assert_output((ULLONG_HALF+FIXNUM_MAX).to_s) do
+ assert_output((ULLONG_MAX-FIXNUM_MAX-1).to_s) do
Num2int.print_num2ull(FIXNUM_MIN-1)
end
assert_output(FIXNUM_MAX.to_s) do