diff --git a/codec/mjpeg/extract_test.go b/codec/mjpeg/extract_test.go index 5d910841..a9f0bd98 100644 --- a/codec/mjpeg/extract_test.go +++ b/codec/mjpeg/extract_test.go @@ -45,26 +45,17 @@ func (r *testReader) Read(b []byte) (int, error) { } func TestExtract(t *testing.T) { - const wantPath = "testdata/expect.mjpeg" - got := &bytes.Buffer{} - - e := NewExtractor() - - r := &testReader{} - err := e.Extract(got, r, 0) + err := NewExtractor().Extract(got, &testReader{}, 0) if err != nil { t.Fatalf("could not extract: %v", err) } - want, err := ioutil.ReadFile(wantPath) + want, err := ioutil.ReadFile("testdata/expect.mjpeg") if err != nil { t.Fatalf("could not read file for wanted MJPEG data: %v", err) } - t.Logf("len(got): %d\n", len(got.Bytes())) - t.Logf("len(want): %d\n", len(want)) - if !bytes.Equal(got.Bytes(), want) { t.Error("did not get expected result") }