(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func 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 | |
| 35 | func TestSetNBitsOfUint16(t *testing.T) { |
| 36 | for _, test := range []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…