diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-28 17:03:02 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-28 17:03:02 +0000 |
commit | 1f4640cf04ed80f1578f897adabcc5db039b7c29 (patch) | |
tree | cf844a6e96bc8512caa836a962381f1b14ea61b9 /test/-ext- | |
parent | 920800b2232b234036070c0310235f39543bb0fd (diff) |
merge revision(s) 54003: [Backport #12153]
* test/-ext-/float/test_nextafter.rb: In AIX,
nextafter(+0.0,-0.0)=+0.0, and nextafter(-0.0,+0.0)=-0.0,
but they should return -0.0 and +0.0, respectively. This is
a known bug in nextafter(3) on AIX, so skip related tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/-ext-')
-rw-r--r-- | test/-ext-/float/test_nextafter.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/-ext-/float/test_nextafter.rb b/test/-ext-/float/test_nextafter.rb index e3a3e726c7..6ecd6fbe5f 100644 --- a/test/-ext-/float/test_nextafter.rb +++ b/test/-ext-/float/test_nextafter.rb @@ -45,9 +45,16 @@ class TestFloatExt < Test::Unit::TestCase if v1 == 0 s1 = 1.0/v1 < 0 ? "negative-zero" : "positive-zero" s2 = 1.0/v2 < 0 ? "negative-zero" : "positive-zero" - assert_equal(s1, s2, - "Bug::Float.missing_nextafter(#{'%a' % n1}, #{'%a' % n2}) = #{'%a' % v1} != " + - "#{'%a' % v2} = Bug::Float.system_nextafter(#{'%a' % n1}, #{'%a' % n2})") + begin + assert_equal(s1, s2, + "Bug::Float.missing_nextafter(#{'%a' % n1}, #{'%a' % n2}) = #{'%a' % v1} != " + + "#{'%a' % v2} = Bug::Float.system_nextafter(#{'%a' % n1}, #{'%a' % n2})") + rescue Minitest::Assertion + if /aix/ =~ RUBY_PLATFORM + skip "Known bug in nextafter(3) on AIX" + end + raise $! + end end end } |