ruby-changes:30674
From: akr <ko1@a...>
Date: Sun, 1 Sep 2013 10:57:48 +0900 (JST)
Subject: [ruby-changes:30674] akr:r42753 (trunk): Add assertions.
akr 2013-09-01 10:57:45 +0900 (Sun, 01 Sep 2013) New Revision: 42753 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42753 Log: Add assertions. Modified files: trunk/test/ruby/test_process.rb Index: test/ruby/test_process.rb =================================================================== --- test/ruby/test_process.rb (revision 42752) +++ test/ruby/test_process.rb (revision 42753) @@ -1751,12 +1751,14 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1751 n = :GETTIMEOFDAY_BASED_CLOCK_REALTIME t = Process.clock_getres(n) assert_kind_of(Float, t, "Process.clock_getres(:#{n})") + assert_equal(1000, Process.clock_getres(n, :nanosecond)) end def test_clock_getres_TIME_BASED_CLOCK_REALTIME n = :TIME_BASED_CLOCK_REALTIME t = Process.clock_getres(n) assert_kind_of(Float, t, "Process.clock_getres(:#{n})") + assert_equal(1000000000, Process.clock_getres(n, :nanosecond)) end def test_clock_getres_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID @@ -1767,6 +1769,7 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1769 return end assert_kind_of(Float, t, "Process.clock_getres(:#{n})") + assert_equal(1000, Process.clock_getres(n, :nanosecond)) end def test_clock_getres_TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID @@ -1777,12 +1780,16 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1780 return end assert_kind_of(Float, t, "Process.clock_getres(:#{n})") + f = Process.clock_getres(n, :hertz) + assert_equal(0, f - f.floor) end def test_clock_getres_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID n = :CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID t = Process.clock_getres(n) assert_kind_of(Float, t, "Process.clock_getres(:#{n})") + f = Process.clock_getres(n, :hertz) + assert_equal(0, f - f.floor) end def test_clock_getres_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/