Skip to content

Commit

Permalink
test(tracker): fix FuzzModel: NullContext implements MIDIContext
Browse files Browse the repository at this point in the history
  • Loading branch information
vsariola committed Oct 14, 2024
1 parent f8f0e11 commit cd88ea0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tracker/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ func (NullContext) BPM() (bpm float64, ok bool) {
return 0, false
}

func (NullContext) ListInputDevices() func(yield func(tracker.MIDIDevice) bool) {
return func(yield func(tracker.MIDIDevice) bool) {}
}

func (NullContext) Close() {}

type modelFuzzState struct {
model *tracker.Model
clipboard []byte
Expand Down Expand Up @@ -253,7 +259,7 @@ func FuzzModel(f *testing.F) {
f.Fuzz(func(t *testing.T, slice []byte) {
reader := bytes.NewReader(slice)
synther := vm.GoSynther{}
model, player := tracker.NewModelPlayer(synther, "")
model, player := tracker.NewModelPlayer(synther, NullContext{}, "")
buf := make([][2]float32, 2048)
closeChan := make(chan struct{})
go func() {
Expand Down

0 comments on commit cd88ea0

Please sign in to comment.