mirror of https://bitbucket.org/ausocean/av.git
av/stream/flac: cleaned up testing file
This commit is contained in:
parent
1104c96a2f
commit
3f41c7b72b
|
@ -64,29 +64,43 @@ func TestWriteSeekerWrite(t *testing.T) {
|
||||||
func TestWriteSeekerSeek(t *testing.T) {
|
func TestWriteSeekerSeek(t *testing.T) {
|
||||||
ws := &writeSeeker{}
|
ws := &writeSeeker{}
|
||||||
|
|
||||||
ws.Write([]byte("hello"))
|
const tstStr1 = "hello"
|
||||||
if string(ws.buf) != "hello" {
|
want1 := tstStr1
|
||||||
t.Fail()
|
ws.Write([]byte(tstStr1))
|
||||||
|
got := string(ws.buf)
|
||||||
|
if got != tstStr1 {
|
||||||
|
t.Errorf("Unexpected output, got: %v, want: %v", got, want1)
|
||||||
}
|
}
|
||||||
|
|
||||||
ws.Write([]byte(" world"))
|
const tstStr2 = " world"
|
||||||
if string(ws.buf) != "hello world" {
|
const want2 = tstStr1 + tstStr2
|
||||||
t.Fail()
|
ws.Write([]byte(tstStr2))
|
||||||
|
got = string(ws.buf)
|
||||||
|
if got != want2 {
|
||||||
|
t.Errorf("Unexpected output, got: %v, want: %v", got, want2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tstStr3 = "k!"
|
||||||
|
const want3 = "hello work!"
|
||||||
ws.Seek(-2, io.SeekEnd)
|
ws.Seek(-2, io.SeekEnd)
|
||||||
ws.Write([]byte("k!"))
|
ws.Write([]byte(tstStr3))
|
||||||
if string(ws.buf) != "hello work!" {
|
got = string(ws.buf)
|
||||||
t.Fail()
|
if got != want3 {
|
||||||
|
t.Errorf("Unexpected output, got: %v, want: %v", got, want3)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tstStr4 = "gopher"
|
||||||
|
const want4 = "hello gopher"
|
||||||
ws.Seek(6, io.SeekStart)
|
ws.Seek(6, io.SeekStart)
|
||||||
ws.Write([]byte("gopher"))
|
ws.Write([]byte(tstStr4))
|
||||||
if string(ws.buf) != "hello gopher" {
|
got = string(ws.buf)
|
||||||
t.Fail()
|
if got != want4 {
|
||||||
|
t.Errorf("Unexpected output, got: %v, want: %v", got, want4)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestDecodeFlac checks that we can load a flac file and decode to wav, writing
|
||||||
|
// to a wav file.
|
||||||
func TestDecodeFlac(t *testing.T) {
|
func TestDecodeFlac(t *testing.T) {
|
||||||
b, err := ioutil.ReadFile(testFile)
|
b, err := ioutil.ReadFile(testFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue