summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-01 01:57:45 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-01 01:57:45 +0000
commite8d8e0696fd12424c622207a0229223a4de052b9 (patch)
tree3a18c126d893fbcfa180ac65ff1ca8b58e4b60e1 /test
parent77f245e62ee7e0bbfd1eb868b759dabe169a29bf (diff)
Add assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_process.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index c31c565f5c..8b15679671 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1751,12 +1751,14 @@ EOS
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
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
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