MCPcopy Create free account
hub / github.com/pion/rtcp / TestGetPadding

Function TestGetPadding

util_test.go:12–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestGetPadding(t *testing.T) {
13 assert := assert.New(t)
14 type testCase struct {
15 input int
16 result int
17 }
18
19 cases := []testCase{
20 {input: 0, result: 0},
21 {input: 1, result: 3},
22 {input: 2, result: 2},
23 {input: 3, result: 1},
24 {input: 4, result: 0},
25 {input: 100, result: 0},
26 {input: 500, result: 0},
27 }
28 for _, testCase := range cases {
29 assert.Equalf(
30 getPadding(testCase.input), testCase.result, "Test case returned wrong value for input %d", testCase.input,
31 )
32 }
33}
34
35func TestSetNBitsOfUint16(t *testing.T) {
36 for _, test := range []struct {

Callers

nothing calls this directly

Calls 1

getPaddingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…