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

ruby-changes:51461

From: nobu <ko1@a...>
Date: Fri, 15 Jun 2018 19:35:21 +0900 (JST)
Subject: [ruby-changes:51461] nobu:r63671 (trunk): gettimeofday is obsolete

nobu	2018-06-15 19:35:13 +0900 (Fri, 15 Jun 2018)

  New Revision: 63671

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

  Log:
    gettimeofday is obsolete
    
    * test/ruby/test_process.rb gettimeofday is obsolete in SUSv4, and
      may not be available in the future.

  Modified files:
    trunk/test/ruby/test_process.rb
Index: test/ruby/test_process.rb
===================================================================
--- test/ruby/test_process.rb	(revision 63670)
+++ test/ruby/test_process.rb	(revision 63671)
@@ -2046,7 +2046,11 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L2046
 
   def test_clock_gettime_GETTIMEOFDAY_BASED_CLOCK_REALTIME
     n = :GETTIMEOFDAY_BASED_CLOCK_REALTIME
-    t = Process.clock_gettime(n)
+    begin
+      t = Process.clock_gettime(n)
+    rescue Errno::EINVAL
+      return
+    end
     assert_kind_of(Float, t, "Process.clock_gettime(:#{n})")
   end
 
@@ -2124,7 +2128,11 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L2128
 
   def test_clock_getres_GETTIMEOFDAY_BASED_CLOCK_REALTIME
     n = :GETTIMEOFDAY_BASED_CLOCK_REALTIME
-    t = Process.clock_getres(n)
+    begin
+      t = Process.clock_getres(n)
+    rescue Errno::EINVAL
+      return
+    end
     assert_kind_of(Float, t, "Process.clock_getres(:#{n})")
     assert_equal(1000, Process.clock_getres(n, :nanosecond))
   end

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

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