MCPcopy
hub / github.com/EngoEngine/engo / TestClockDelta

Function TestClockDelta

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

Source from the content-addressed store, hash-verified

58}
59
60func TestClockDelta(t *testing.T) {
61 data := []struct {
62 delta int64
63 }{
64 {6000000000},
65 {16666667},
66 {33333333},
67 {66666666},
68 {60},
69 }
70 for _, d := range data {
71 exp := float32(d.delta) / 1000000000.0
72 theTimer = testTime{0}
73 clock := NewClock()
74 theTimer = testTime{d.delta}
75 clock.Tick()
76 if clock.Delta() != exp {
77 t.Errorf("Clock's Delta did not match %v, was %v", exp, clock.Delta())
78 }
79 }
80}
81
82func TestClockTime(t *testing.T) {
83 data := []struct {

Callers

nothing calls this directly

Calls 3

TickMethod · 0.95
DeltaMethod · 0.95
NewClockFunction · 0.85

Tested by

no test coverage detected