(c *C)
| 67 | } |
| 68 | |
| 69 | func (s *BinarySuite) TestReadVariableWidthIntOverflow(c *C) { |
| 70 | // A continuation byte every iteration accumulates 7 bits and a +1 |
| 71 | // adjustment per byte; eleven such bytes pushes the running int64 |
| 72 | // past its bound and the decoder must reject the input. |
| 73 | buf := bytes.NewBuffer(bytes.Repeat([]byte{0xFF}, 11)) |
| 74 | |
| 75 | _, err := ReadVariableWidthInt(buf) |
| 76 | c.Assert(err, Equals, ErrIntegerOverflow) |
| 77 | } |
| 78 | |
| 79 | func (s *BinarySuite) TestReadVariableWidthIntBoundary(c *C) { |
| 80 | // Crafted input that drives the running accumulator to exactly |
nothing calls this directly
no test coverage detected