tai64n: account for whitening in test
This commit is contained in:
parent
32912dc778
commit
d0ab883ada
@ -15,11 +15,15 @@ import (
|
|||||||
*/
|
*/
|
||||||
func TestMonotonic(t *testing.T) {
|
func TestMonotonic(t *testing.T) {
|
||||||
old := Now()
|
old := Now()
|
||||||
for i := 0; i < 10000; i++ {
|
for i := 0; i < 50; i++ {
|
||||||
time.Sleep(time.Nanosecond)
|
|
||||||
next := Now()
|
next := Now()
|
||||||
|
if next.After(old) {
|
||||||
|
t.Error("Whitening insufficient")
|
||||||
|
}
|
||||||
|
time.Sleep(time.Duration(whitenerMask)/time.Nanosecond + 1)
|
||||||
|
next = Now()
|
||||||
if !next.After(old) {
|
if !next.After(old) {
|
||||||
t.Error("TAI64N, not monotonically increasing on nano-second scale")
|
t.Error("Not monotonically increasing on whitened nano-second scale")
|
||||||
}
|
}
|
||||||
old = next
|
old = next
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user