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

Function TestClockTick

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

Source from the content-addressed store, hash-verified

16}
17
18func TestClockTick(t *testing.T) {
19 theTimer = testTime{0}
20 clock := NewClock()
21 before := clock.counter
22 clock.Tick()
23 after := clock.counter
24 if after != before+1 {
25 t.Errorf("Tick did not increase the counter, before: %v, after: %v", before, after)
26 }
27 theTimer = testTime{1000000000}
28 clock.Tick()
29 if clock.counter != 0 {
30 t.Error("Clock's count did not reset to 0 after waiting over 1 second")
31 }
32}
33
34func TestClockFPS(t *testing.T) {
35 data := []struct {

Callers

nothing calls this directly

Calls 3

TickMethod · 0.95
NewClockFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected