(b *testing.B)
| 37 | } |
| 38 | |
| 39 | func BenchmarkReadMapHeaderBytes(b *testing.B) { |
| 40 | sizes := []uint32{1, 100, tuint16, tuint32} |
| 41 | buf := make([]byte, 0, 5*len(sizes)) |
| 42 | for _, sz := range sizes { |
| 43 | buf = AppendMapHeader(buf, sz) |
| 44 | } |
| 45 | b.SetBytes(int64(len(buf) / len(sizes))) |
| 46 | b.ReportAllocs() |
| 47 | b.ResetTimer() |
| 48 | o := buf |
| 49 | for i := 0; i < b.N; i++ { |
| 50 | _, buf, _ = ReadMapHeaderBytes(buf) |
| 51 | if len(buf) == 0 { |
| 52 | buf = o |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | func TestReadArrayHeaderBytes(t *testing.T) { |
| 58 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected
searching dependent graphs…