(t *testing.T)
| 477 | } |
| 478 | |
| 479 | func TestReadFixedWidthSliceBytes(t *testing.T) { |
| 480 | t.Run("unaligned_size", func(t *testing.T) { |
| 481 | buf := NewByteBuffer(nil) |
| 482 | buf.WriteLength(3) |
| 483 | buf.WriteBinary([]byte{1, 2, 3}) |
| 484 | buf.SetReaderIndex(0) |
| 485 | |
| 486 | err := &Error{} |
| 487 | result := ReadInt16Slice(buf, err) |
| 488 | |
| 489 | assert.True(t, err.HasError()) |
| 490 | assert.Nil(t, result) |
| 491 | }) |
| 492 | |
| 493 | t.Run("missing_body", func(t *testing.T) { |
| 494 | buf := NewByteBuffer(nil) |
| 495 | buf.WriteLength(40000) |
| 496 | buf.SetReaderIndex(0) |
| 497 | |
| 498 | err := &Error{} |
| 499 | result := ReadFloat64Slice(buf, err) |
| 500 | |
| 501 | assert.True(t, err.HasError()) |
| 502 | assert.Nil(t, result) |
| 503 | }) |
| 504 | } |
| 505 | |
| 506 | func TestReadBoolSliceWrappedBuffer(t *testing.T) { |
| 507 | arrayBytes := NewByteBuffer(nil) |
nothing calls this directly
no test coverage detected