Failures against Ruby 1.8 branch's test_bigdecimal --------------------------------------------------
Key: JRUBY-4917 URL: http://jira.codehaus.org/browse/JRUBY-4917 Project: JRuby Issue Type: Bug Components: Extensions Affects Versions: JRuby 1.5.1 Reporter: Charles Oliver Nutter Priority: Minor There are several failures against test/bigdecimal/test_bigdecimal.rb from Ruby's ruby_1_8 branch. One of them (test_exception_overflow) runs forever (also needs to be fixed), so I applied the following patch to get the rest to run: {noformat} diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb index 78c50f6..b0ab85c 100644 --- a/test/bigdecimal/test_bigdecimal.rb +++ b/test/bigdecimal/test_bigdecimal.rb @@ -64,7 +64,7 @@ class TestBigDecimal < Test::Unit::TestCase end end end - +=begin def test_exception_overflow _test_mode(BigDecimal::EXCEPTION_OVERFLOW) do x = BigDecimal.new("10") @@ -73,7 +73,7 @@ class TestBigDecimal < Test::Unit::TestCase end end end - +=end def test_exception_zerodivide BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) _test_mode(BigDecimal::EXCEPTION_ZERODIVIDE) { 1 / BigDecimal.new("0") } {noformat} The remaining failures are below. {noformat} 1) Failure: test_add(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:357]: <-1> expected but was <1>. 2) Failure: test_ctov(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:685]: <3> expected but was <1>. 3) Failure: test_div(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:389]: <-1> expected but was <1>. 4) Failure: test_divmod(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:418]: <ZeroDivisionError> exception expected but none was thrown. 5) Failure: test_exception_underflow(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:39:in `_test_mode' test/bigdecimal/test_bigdecimal.rb:60:in `test_exception_underflow']: <FloatDomainError> exception expected but was Class: <Java::JavaLang::ArithmeticException> Message: <"Underflow"> ---Backtrace--- java.math.BigDecimal.checkScale(BigDecimal.java:3683) java.math.BigDecimal.multiply(BigDecimal.java:1288) org.jruby.RubyBigDecimal.mult2(RubyBigDecimal.java:528) org.jruby.RubyBigDecimal.op_mul(RubyBigDecimal.java:492) org.jruby.RubyBigDecimal$i_method_1_0$RUBYINVOKER$op_mul.call(org/jruby/RubyBigDecimal$i_method_1_0$RUBYINVOKER$op_mul.gen:65535) org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:150) test.bigdecimal.test_bigdecimal.block_9$RUBY$__block__(test_bigdecimal.rb:63) ... --------------- 6) Failure: test_gc(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:696:in `test_gc' test/bigdecimal/test_bigdecimal.rb:694:in `times' test/bigdecimal/test_bigdecimal.rb:694:in `test_gc']: [ruby-dev:41213]. <[1, "1", 10, 1]> expected but was <["0.1E1"]>. 7) Failure: test_global_new(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:20]: <ArgumentError> exception expected but none was thrown. 8) Failure: test_limit(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:608]: <90> expected but was <#<BigDecimal:12cfd62,'0.81E2',2(4)>>. 9) Failure: test_marshal(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:270]: <TypeError> exception expected but was Class: <Java::JavaLang::NumberFormatException> Message: <nil> ---Backtrace--- java.math.BigDecimal.<init>(BigDecimal.java:459) java.math.BigDecimal.<init>(BigDecimal.java:728) org.jruby.RubyBigDecimal.load(RubyBigDecimal.java:172) org.jruby.RubyBigDecimal$s_method_1_0$RUBYFRAMEDINVOKER$load.call(org/jruby/RubyBigDecimal$s_method_1_0$RUBYFRAMEDINVOKER$load.gen:65535) org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:319) org.jruby.RubyClass.finvoke(RubyClass.java:662) org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:455) org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:338) org.jruby.runtime.marshal.UnmarshalStream.userUnmarshal(UnmarshalStream.java:344) org.jruby.runtime.marshal.UnmarshalStream.unmarshalObjectDirectly(UnmarshalStream.java:203) org.jruby.runtime.marshal.UnmarshalStream.unmarshalObject(UnmarshalStream.java:95) org.jruby.RubyMarshal.load(RubyMarshal.java:165) org.jruby.RubyMarshal$s_method_0_1$RUBYFRAMEDINVOKER$load.call(org/jruby/RubyMarshal$s_method_0_1$RUBYFRAMEDINVOKER$load.gen:65535) org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192) org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:188) org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313) org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:152) test.bigdecimal.test_bigdecimal.block_16$RUBY$__block__(test_bigdecimal.rb:270) ... --------------- 10) Failure: test_new(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:28]: <0> expected but was <#<BigDecimal:1e852be,'0.111E3',3(4)>>. 11) Failure: test_power(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:588]: <#<BigDecimal:51630a,'-Infinity',1(4)>> expected but was <#<BigDecimal:145d424,'Infinity',1(4)>>. 12) Failure: test_round(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:522]: <TypeError> exception expected but was Class: <Java::JavaLang::IllegalArgumentException> Message: <"Invalid rounding mode"> ---Backtrace--- java.math.BigDecimal.setScale(BigDecimal.java:2368) org.jruby.RubyBigDecimal.round(RubyBigDecimal.java:1078) org.jruby.RubyBigDecimal$i_method_0_2$RUBYINVOKER$round.call(org/jruby/RubyBigDecimal$i_method_0_2$RUBYINVOKER$round.gen:65535) org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:634) org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:196) org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:333) org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:192) test.bigdecimal.test_bigdecimal.block_24$RUBY$__block__(test_bigdecimal.rb:522) ... --------------- 13) Failure: test_round_up(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:93]: <#<BigDecimal:db681c,'0.4E1',1(4)>> expected to be < <#<BigDecimal:90288e,'0.399999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999996E1',201(204)>>. 14) Failure: test_sqrt_bigdecimal(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:474]: <1267650600228229401496703205376> expected but was <#<BigDecimal:13cba41,'0.12677E31',5(8)>>. 15) Failure: test_sub(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:370]: <-1> expected but was <1>. 16) Failure: test_sub_bigdecimal(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:430]: <1000000000000000000000000000000> expected but was <#<BigDecimal:2d4c7e,'0.1267650600228229401496703205375E31',31(32)>>. 17) Failure: test_to_f(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:332]: <FloatDomainError> exception expected but none was thrown. 18) Failure: test_to_i(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:304]: <FloatDomainError> exception expected but none was thrown. 19) Failure: test_to_s(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:551]: <"0.12345 67890 12345 6789E3"> expected but was <"0.12345 67890 12345 67890E3">. 20) Failure: test_to_special_string(TestBigDecimal) [test/bigdecimal/test_bigdecimal.rb:661]: <" Infinity"> expected but was <"Infinity">. 55 tests, 247 assertions, 20 failures, 0 errors {noformat} -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email