]> Cypherpunks repositories - gostls13.git/commitdiff
change time.Tick test to use 100ms intervals.
authorRuss Cox <rsc@golang.org>
Mon, 5 Jan 2009 19:18:20 +0000 (11:18 -0800)
committerRuss Cox <rsc@golang.org>
Mon, 5 Jan 2009 19:18:20 +0000 (11:18 -0800)
now passes even under loaded conditions on r45.

R=r
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=22019
CL=22022

src/lib/time/tick_test.go

index f9b18fc1d9e636ba48a59b4b01ae5f8f59ea8322..85eb52e0fd844f085d5dd351db0819e28a01ba3a 100644 (file)
@@ -11,7 +11,7 @@ import (
 
 export func TestTick(t *testing.T) {
        const (
-               Delta uint64 = 10*1e6;
+               Delta uint64 = 100*1e6;
                Count uint64 = 10;
        );
        c := Tick(Delta);
@@ -24,6 +24,6 @@ export func TestTick(t *testing.T) {
        target := int64(Delta*Count);
        slop := target*2/10;
        if ns < target - slop || ns > target + slop {
-               t.Fatalf("%d ticks of %d ns took %d ns, expected %d", Count, Delta, ns, target);
+               t.Fatalf("%d ticks of %g ns took %g ns, expected %g", Count, float64(Delta), float64(ns), float64(target));
        }
 }