Open tone-test output before transmission
This commit is contained in:
committed by
Brandon McGinty
parent
d64e5125dd
commit
e564bb8583
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Regression: tone transmission was started before opening its output file,
|
||||
// so a creation error left audio transmission running without cleanup.
|
||||
func TestNewAudioFileSaverReportsUnavailableOutputPath(t *testing.T) {
|
||||
path := filepath.Join(t.TempDir(), "missing", "tone.pcm")
|
||||
if saver, err := NewAudioFileSaver(path); err == nil || saver != nil {
|
||||
t.Fatalf("got saver=%v err=%v", saver, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user