Merge commit r32996 from trunk:

* ext/bigdecimal/bigdecimal.c (cannot_be_coerced_into_BigDecimal):
      add a new function for raising error when an object cannot coerce
      into BigDecimal.  [Bug #5172]
    * ext/bigdecimal/bigdecimal.c (BigDecimalValueWithPrec): use
      cannot_be_coerced_into_BigDecimal function.
    * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): ditto.
    * ext/bigdecimal/bigdecimal.c (BigMath_s_log): ditto.
    * test/bigdecimal/test_bigdecimal.rb: test for the avobe changes.
    * test/bigdecimal/testbase.rb (under_gc_stress): add a new utility
      method to run tests under the condition of GC.stress = true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mrkn 2011-08-17 06:52:00 +00:00
parent 559b717567
commit bc6c037f84
4 changed files with 93 additions and 7 deletions

View file

@ -17,4 +17,11 @@ module TestBigDecimalBase
BigDecimal.mode(mode, !(@mode & mode).zero?)
end
end
def under_gc_stress
stress, GC.stress = GC.stress, true
yield
ensure
GC.stress = stress
end
end