Skip to content

Commit eb16ccf

Browse files
authored
Add some tests for MultiTrackBlockSorter (#156)
1 parent 4bf7a63 commit eb16ccf

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

mkvcore/framebuf_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ func TestFrameBuffer(t *testing.T) {
2626
t.Errorf("Pop() must return nil if empty, expected: nil, got %v", h)
2727
}
2828

29+
if f := buf.Tail(); f != nil {
30+
t.Errorf("Tail() must return nil if empty, expected: nil, got %v", f)
31+
}
32+
2933
if n := buf.Size(); n != 0 {
3034
t.Errorf("Size() must return 0 at beginning, got %d", n)
3135
}
@@ -46,6 +50,9 @@ func TestFrameBuffer(t *testing.T) {
4650
if h := buf.Head(); !reflect.DeepEqual(*h, frames[0]) {
4751
t.Errorf("Head() must return first frame, expected: %v, got %v", frames[0].trackNumber, *h)
4852
}
53+
if f := buf.Tail(); !reflect.DeepEqual(*f, frames[1]) {
54+
t.Errorf("Tail() must return last frame, expected: %v, got %v", frames[1].trackNumber, *f)
55+
}
4956

5057
if h := buf.Pop(); !reflect.DeepEqual(*h, frames[0]) {
5158
t.Errorf("Pop() must return first frame, expected: %v, got %v", frames[0].trackNumber, *h)

mkvcore/interceptor_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ func TestMultiTrackBlockSorter_FailingOptions(t *testing.T) {
278278
},
279279
err: errDummy,
280280
},
281+
"ErroredOption": {
282+
opts: []MultiTrackBlockSorterOption{
283+
func(*MultiTrackBlockSorterOptions) error {
284+
return errDummy
285+
},
286+
},
287+
err: errDummy,
288+
},
281289
}
282290

283291
for name, c := range cases {

0 commit comments

Comments
 (0)