(t *testing.T)
| 62 | } |
| 63 | |
| 64 | func TestByteModeLengthCalculations(t *testing.T) { |
| 65 | tests := []struct { |
| 66 | dataEncoderType dataEncoderType |
| 67 | dataMode dataMode |
| 68 | numSymbols int |
| 69 | expectedLength int |
| 70 | }{} |
| 71 | |
| 72 | for i, test := range tests { |
| 73 | encoder := newDataEncoder(test.dataEncoderType) |
| 74 | var resultLength int |
| 75 | |
| 76 | resultLength, err := encoder.encodedLength(test.dataMode, test.numSymbols) |
| 77 | |
| 78 | if test.expectedLength == -1 { |
| 79 | if err == nil { |
| 80 | t.Errorf("Test %d: got length %d, expected error", i, resultLength) |
| 81 | } |
| 82 | } else if resultLength != test.expectedLength { |
| 83 | t.Errorf("Test %d: got length %d, expected length %d", i, resultLength, |
| 84 | test.expectedLength) |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | func TestSingleModeEncodings(t *testing.T) { |
| 90 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…