mirror of https://bitbucket.org/ausocean/av.git
protocol/rtp: wrote TestCsrcCount
Wrote test TestCsrcCount to check behaviour of csrcCount is expected.
This commit is contained in:
parent
74b25e646a
commit
c2b67d7fb9
|
@ -40,3 +40,18 @@ func TestVersion(t *testing.T) {
|
|||
t.Errorf("unexpected version for RTP packet. Got: %v\n Want: %v\n", got, expect)
|
||||
}
|
||||
}
|
||||
|
||||
// TestCsrcCount checks that we can correctly obtain the csrc count from an
|
||||
// RTP packet.
|
||||
func TestCsrcCount(t *testing.T) {
|
||||
const ver, expect = 2, 2
|
||||
pkt := (&Pkt{
|
||||
V: ver,
|
||||
CC: expect,
|
||||
CSRC: make([][4]byte, expect),
|
||||
}).Bytes(nil)
|
||||
got := csrcCount(pkt)
|
||||
if got != expect {
|
||||
t.Errorf("unexpected csrc count for RTP packet. Got: %v\n Want: %v\n", got, expect)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue