forked from Eyevinn/mp4ff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmdhd_test.go
41 lines (37 loc) · 858 Bytes
/
mdhd_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package mp4
import (
"testing"
)
func TestMdhd(t *testing.T) {
boxes := []*MdhdBox{
{
Version: 0,
Flags: 0,
CreationTime: 12,
ModificationTime: 13,
Timescale: 10000,
Duration: 10000,
Language: 0, // 16-bit. Set from "eng" later
},
{
Version: 1,
Flags: 0,
CreationTime: 12,
ModificationTime: 13,
Timescale: 10000,
Duration: 10000,
Language: 0, // 16-bit. Set from "eng" later
},
}
for _, mdhd := range boxes {
language := "eng"
mdhd.SetLanguage(language)
boxDiffAfterEncodeAndDecode(t, mdhd)
outBox := boxAfterEncodeAndDecode(t, mdhd)
mdhdOut := outBox.(*MdhdBox)
gotLanguage := mdhdOut.GetLanguage()
if gotLanguage != language {
t.Errorf("Got %q, want %q", gotLanguage, language)
}
}
}