revid: added test for newMultiSender

This commit is contained in:
Saxon 2019-03-12 16:28:30 +10:30
parent 3761b55f87
commit e7e3b5007b
1 changed files with 16 additions and 0 deletions

View File

@ -249,3 +249,19 @@ func TestMtsSenderDiscontinuity(t *testing.T) {
t.Fatalf("Did not get discontinuity indicator for PAT") t.Fatalf("Did not get discontinuity indicator for PAT")
} }
} }
// TestNewMultiSender checks that newMultiSender performs as expected when an
// active function is not provided, and when an active function is provided.
func TestNewMultiSender(t *testing.T) {
// First test without giving an 'active' function.
_, err := newMultiSender(nil, false, nil)
if err == nil {
t.Error("did not get expected error on creation of multiSender without active function")
}
// Now test with providing an active function
_, err = newMultiSender(nil, false, func() bool { return true })
if err != nil {
t.Errorf("did not expect to get error on creation of multiSender with active func provided, err: %v", err)
}
}