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
015b1f7aa9
commit
96debea062
protocol/rtp
|
@ -40,3 +40,18 @@ func TestVersion(t *testing.T) {
|
||||||
t.Errorf("unexpected version for RTP packet. Got: %v\n Want: %v\n", got, expect)
|
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