Unbewohnte
3 years ago
9 changed files with 96 additions and 52 deletions
Binary file not shown.
@ -1,16 +1,27 @@
|
||||
package v2 |
||||
|
||||
// func TestReadFrame(t *testing.T) {
|
||||
// f, err := os.Open(filepath.Join(TESTDATAPATH, "testreadv2.mp3"))
|
||||
// if err != nil {
|
||||
// t.Errorf("%s", err)
|
||||
// }
|
||||
import ( |
||||
"io" |
||||
"os" |
||||
"path/filepath" |
||||
"testing" |
||||
) |
||||
|
||||
// // read right after header`s bytes
|
||||
// f.Seek(int64(HEADERSIZE), io.SeekStart)
|
||||
func TestReadFrame(t *testing.T) { |
||||
f, err := os.Open(filepath.Join(TESTDATAPATH, "testreadv2.mp3")) |
||||
if err != nil { |
||||
t.Errorf("%s", err) |
||||
} |
||||
|
||||
// _, err = Readv2Frame(f)
|
||||
// if err != nil {
|
||||
// t.Errorf("ReadFrame failed: %s", err)
|
||||
// }
|
||||
// }
|
||||
// read right after header`s bytes
|
||||
f.Seek(int64(HEADERSIZE), io.SeekStart) |
||||
|
||||
firstFrame, err := ReadFrame(f) |
||||
if err != nil { |
||||
t.Errorf("ReadFrame failed: %s", err) |
||||
} |
||||
|
||||
if firstFrame.Header.ID != "TRCK" { |
||||
t.Errorf("ReadFrame failed: expected ID %s; got %s", "TRCK", firstFrame.Header.ID) |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue