[前][次][番号順一覧][スレッド一覧]

ruby-changes:41929

From: odaira <ko1@a...>
Date: Sat, 5 Mar 2016 07:43:36 +0900 (JST)
Subject: [ruby-changes:41929] odaira:r54003 (trunk): * test/-ext-/float/test_nextafter.rb: In AIX,

odaira	2016-03-05 07:43:31 +0900 (Sat, 05 Mar 2016)

  New Revision: 54003

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54003

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/test/-ext-/float/test_nextafter.rb
Index: test/-ext-/float/test_nextafter.rb
===================================================================
--- test/-ext-/float/test_nextafter.rb	(revision 54002)
+++ test/-ext-/float/test_nextafter.rb	(revision 54003)
@@ -46,9 +46,16 @@ class TestFloatExt < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/-ext-/float/test_nextafter.rb#L46
           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
       }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54002)
+++ ChangeLog	(revision 54003)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Mar  5 07:36:27 2016  Rei Odaira  <Rei.Odaira@g...>
+
+	* 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.
+
 Sat Mar  5 07:14:10 2016  Rei Odaira  <Rei.Odaira@g...>
 
 	* test/zlib/test_zlib.rb (test_adler32_combine, test_crc32_combine):

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]