@@ -12,7 +12,12 @@ class TestBigDecimal < Test::Unit::TestCase
1212 require 'fiddle'
1313 LONG_MAX = ( 1 << ( Fiddle ::SIZEOF_LONG *8 - 1 ) ) - 1
1414 LONG_MIN = [ LONG_MAX + 1 ] . pack ( "L!" ) . unpack ( "l!" ) [ 0 ]
15+ LLONG_MAX = ( 1 << ( Fiddle ::SIZEOF_LONG_LONG *8 - 1 ) ) - 1
16+ LLONG_MIN = [ LLONG_MAX + 1 ] . pack ( "Q!" ) . unpack ( "q!" ) [ 0 ]
17+ ULLONG_MAX = ( 1 << Fiddle ::SIZEOF_LONG_LONG *8 ) - 1
1518 LIMITS = {
19+ "LLONG_MIN" => LLONG_MIN ,
20+ "ULLONG_MAX" => ULLONG_MAX ,
1621 "FIXNUM_MIN" => LONG_MIN / 2 ,
1722 "FIXNUM_MAX" => LONG_MAX / 2 ,
1823 "INT64_MIN" => -9223372036854775808 ,
@@ -2092,10 +2097,9 @@ def test_initialize_copy_dup_clone_frozen_error
20922097 def test_llong_min_gh_200
20932098 # https://github.com/ruby/bigdecimal/issues/199
20942099 # Between LLONG_MIN and -ULLONG_MAX
2095- llong_min = -( 2 ** 63 + 1 )
2096- assert_equal ( BigDecimal ( llong_min . to_s ) , BigDecimal ( llong_min ) , "[GH-200]" )
2100+ assert_equal ( BigDecimal ( LIMITS [ "LLONG_MIN" ] . to_s ) , BigDecimal ( LIMITS [ "LLONG_MIN" ] ) , "[GH-200]" )
20972101
2098- minus_ullong_max = -( 2 ** 64 - 1 )
2102+ minus_ullong_max = -LIMITS [ "ULLONG_MAX" ]
20992103 assert_equal ( BigDecimal ( minus_ullong_max . to_s ) , BigDecimal ( minus_ullong_max ) , "[GH-200]" )
21002104 end
21012105
0 commit comments