(t *testing.T)
| 514 | } |
| 515 | |
| 516 | func TestReadBufferObjectRejectsTruncatedInBandData(t *testing.T) { |
| 517 | buf := NewByteBuffer(nil) |
| 518 | buf.WriteBool(true) |
| 519 | buf.WriteVarUint32(4) |
| 520 | buf.WriteBinary([]byte{1, 2}) |
| 521 | |
| 522 | ctx := NewReadContext(false) |
| 523 | ctx.SetData(buf.Bytes()) |
| 524 | |
| 525 | require.Nil(t, ctx.ReadBufferObject()) |
| 526 | require.Error(t, ctx.CheckError()) |
| 527 | } |
| 528 | |
| 529 | func TestReadBufferObjectCopiesInBandDataFromStream(t *testing.T) { |
| 530 | data := []byte{1, 3, 10, 11, 12, 20, 21, 22, 23, 24, 25} |
nothing calls this directly
no test coverage detected