summaryrefslogtreecommitdiff
path: root/test/bigdecimal/test_bigdecimal.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-25 18:02:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-25 18:02:42 +0000
commita426373520a0d633b23be87425b05ac86ed45127 (patch)
treeb1925498c6401d099592e78fc31af83f0447cd2c /test/bigdecimal/test_bigdecimal.rb
parent20681e37cacb24ddf2d6fb39dab2ff290e6863ca (diff)
* ext/bigdecimal/bigdecimal.c (VpAlloc): avoid ALLOCA_N() to avoid
segmentation fault caused by (insanely) long decimal values. [ruby-dev:37189] fix #794 * ext/bigdecimal/bigdecimal.c (BigDecimal_dump, BigDecimal_to_i, BigDecimal_to_f, BigDecimal_to_s, BigDecimal_split, BigDecimal_inspect): ditto. * ext/bigdecimal/bigdecimal.c (VpToString): small performance improvement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/bigdecimal/test_bigdecimal.rb')
-rw-r--r--test/bigdecimal/test_bigdecimal.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
index 35edc7a44a3..98fad678678 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -303,9 +303,9 @@ class TestBigDecimal < Test::Unit::TestCase
x = BigDecimal.new("0")
assert_kind_of(Integer, x.to_i)
assert_equal(0, x.to_i)
- assert_nil(( 1 / x).to_i)
- assert_nil((-1 / x).to_i)
- assert_nil(( 0 / x).to_i)
+ assert_raise(FloatDomainError){( 1 / x).to_i}
+ assert_raise(FloatDomainError){(-1 / x).to_i}
+ assert_raise(FloatDomainError){( 0 / x).to_i}
x = BigDecimal.new("1")
assert_equal(1, x.to_i)
x = BigDecimal.new((2**100).to_s)