(t *testing.T)
| 462 | } |
| 463 | |
| 464 | func TestReadInt32Slice_OOM_Bug(t *testing.T) { |
| 465 | // We claim a size of 40,000 bytes, but provide no actual data. |
| 466 | buf := NewByteBuffer(nil) |
| 467 | buf.WriteLength(40000) |
| 468 | |
| 469 | // Reset reader index so we can read what we just wrote |
| 470 | buf.SetReaderIndex(0) |
| 471 | |
| 472 | err := &Error{} |
| 473 | result := ReadInt32Slice(buf, err) |
| 474 | |
| 475 | assert.True(t, err.HasError(), "Expected an error due to out of bounds buffer") |
| 476 | assert.Equal(t, 0, len(result), "Expected an empty slice due to missing data") |
| 477 | } |
| 478 | |
| 479 | func TestReadFixedWidthSliceBytes(t *testing.T) { |
| 480 | t.Run("unaligned_size", func(t *testing.T) { |
nothing calls this directly
no test coverage detected