MCPcopy Index your code
hub / github.com/EngoEngine/engo / TestClockTime

Function TestClockTime

clock_test.go:82–101  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

80}
81
82func TestClockTime(t *testing.T) {
83 data := []struct {
84 time int64
85 }{
86 {6000000000},
87 {16666667},
88 {33333333},
89 {66666666},
90 {60},
91 }
92 for _, d := range data {
93 exp := float32(d.time) / 1000000000.0
94 theTimer = testTime{0}
95 clock := NewClock()
96 theTimer = testTime{d.time}
97 if clock.Time() != exp {
98 t.Errorf("Clock's duration from Time() did not match %v seconds, was %v", exp, clock.Time())
99 }
100 }
101}
102
103func TestTheTimerNow(t *testing.T) {
104 theTimer = realTime{}

Callers

nothing calls this directly

Calls 2

TimeMethod · 0.95
NewClockFunction · 0.85

Tested by

no test coverage detected