added dsf support, reusing the existing ID3 parser (#43)

This commit is contained in:
ilkomiliev
2018-11-05 09:57:29 +11:00
committed by David Howden
parent 34f7f1e3c8
commit a9f04c2798
6 changed files with 164 additions and 6 deletions
+35
View File
@@ -79,3 +79,38 @@ func TestGetInt(t *testing.T) {
}
}
}
func TestGetIntLittleEndian(t *testing.T) {
tests := []struct {
input []byte
output int
}{
{
[]byte{},
0,
},
{
[]byte{0x01},
1,
},
{
[]byte{0xF1, 0xF2},
0xF2F1,
},
{
[]byte{0xF1, 0xF2, 0xF3},
0xF3F2F1,
},
{
[]byte{0xF1, 0xF2, 0xF3, 0xF4},
0xF4F3F2F1,
},
}
for ii, tt := range tests {
got := getIntLittleEndian(tt.input)
if got != tt.output {
t.Errorf("[%d] getInt(%v) = %v, expected %v", ii, tt.input, got, tt.output)
}
}
}