(b *testing.B)
| 599 | } |
| 600 | |
| 601 | func BenchmarkReadUintWithInt64(b *testing.B) { |
| 602 | us := []uint64{0, 1, 10000, uint64(rand.Uint32() * 4)} |
| 603 | data := make([]byte, 0, 9*len(us)) |
| 604 | for _, n := range us { |
| 605 | data = AppendUint64(data, n) |
| 606 | } |
| 607 | rd := NewReader(NewEndlessReader(data, b)) |
| 608 | b.SetBytes(int64(len(data) / len(us))) |
| 609 | b.ReportAllocs() |
| 610 | b.ResetTimer() |
| 611 | for i := 0; i < b.N; i++ { |
| 612 | _, err := rd.ReadInt64() |
| 613 | if err != nil { |
| 614 | b.Fatal(err) |
| 615 | } |
| 616 | } |
| 617 | } |
| 618 | |
| 619 | func TestReadUint64(t *testing.T) { |
| 620 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected
searching dependent graphs…