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

Function TestAnimationComponentNextFrameNoData

common/animation_test.go:189–209  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

187}
188
189func TestAnimationComponentNextFrameNoData(t *testing.T) {
190 var buf bytes.Buffer
191 log.SetOutput(&buf)
192 drawables := []Drawable{
193 &TestDrawable{0},
194 &TestDrawable{1},
195 &TestDrawable{2},
196 }
197 ac := NewAnimationComponent(drawables, 0.1)
198 action := &Animation{
199 Name: "action",
200 Frames: []int{},
201 }
202 ac.AddAnimation(action)
203 ac.SelectAnimationByAction(action)
204 ac.NextFrame()
205
206 if strings.HasSuffix(buf.String(), "No data for this animation") {
207 t.Errorf("Wrong message recieved when NextFrame was called with no data. Got: %v", buf.String())
208 }
209}
210
211type TestAnimationEntity struct {
212 *ecs.BasicEntity

Callers

nothing calls this directly

Calls 4

AddAnimationMethod · 0.95
NextFrameMethod · 0.95
NewAnimationComponentFunction · 0.85

Tested by

no test coverage detected