mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
77f245e62e
commit
e8d8e0696f
1 changed files with 7 additions and 0 deletions
|
@ -1751,12 +1751,14 @@ EOS
|
||||||
n = :GETTIMEOFDAY_BASED_CLOCK_REALTIME
|
n = :GETTIMEOFDAY_BASED_CLOCK_REALTIME
|
||||||
t = Process.clock_getres(n)
|
t = Process.clock_getres(n)
|
||||||
assert_kind_of(Float, t, "Process.clock_getres(:#{n})")
|
assert_kind_of(Float, t, "Process.clock_getres(:#{n})")
|
||||||
|
assert_equal(1000, Process.clock_getres(n, :nanosecond))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_clock_getres_TIME_BASED_CLOCK_REALTIME
|
def test_clock_getres_TIME_BASED_CLOCK_REALTIME
|
||||||
n = :TIME_BASED_CLOCK_REALTIME
|
n = :TIME_BASED_CLOCK_REALTIME
|
||||||
t = Process.clock_getres(n)
|
t = Process.clock_getres(n)
|
||||||
assert_kind_of(Float, t, "Process.clock_getres(:#{n})")
|
assert_kind_of(Float, t, "Process.clock_getres(:#{n})")
|
||||||
|
assert_equal(1000000000, Process.clock_getres(n, :nanosecond))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_clock_getres_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID
|
def test_clock_getres_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID
|
||||||
|
@ -1767,6 +1769,7 @@ EOS
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
assert_kind_of(Float, t, "Process.clock_getres(:#{n})")
|
assert_kind_of(Float, t, "Process.clock_getres(:#{n})")
|
||||||
|
assert_equal(1000, Process.clock_getres(n, :nanosecond))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_clock_getres_TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID
|
def test_clock_getres_TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID
|
||||||
|
@ -1777,12 +1780,16 @@ EOS
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
assert_kind_of(Float, 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
|
end
|
||||||
|
|
||||||
def test_clock_getres_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID
|
def test_clock_getres_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID
|
||||||
n = :CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID
|
n = :CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID
|
||||||
t = Process.clock_getres(n)
|
t = Process.clock_getres(n)
|
||||||
assert_kind_of(Float, 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
|
end
|
||||||
|
|
||||||
def test_clock_getres_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC
|
def test_clock_getres_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC
|
||||||
|
|
Loading…
Add table
Reference in a new issue