(b *testing.B)
| 63 | } |
| 64 | |
| 65 | func BenchmarkWritePacket(b *testing.B) { |
| 66 | b.StopTimer() |
| 67 | ci := gopacket.CaptureInfo{ |
| 68 | Timestamp: time.Unix(0x01020304, 0xAA*1000), |
| 69 | Length: 0xABCD, |
| 70 | CaptureLength: 10, |
| 71 | } |
| 72 | data := []byte{9, 8, 7, 6, 5, 4, 3, 2, 1, 0} |
| 73 | var buf bytes.Buffer |
| 74 | w := NewWriter(&buf) |
| 75 | b.StartTimer() |
| 76 | |
| 77 | for i := 0; i < b.N; i++ { |
| 78 | w.WritePacket(ci, data) |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | func TestCaptureInfoErrors(t *testing.T) { |
| 83 | data := []byte{1, 2, 3, 4} |
nothing calls this directly
no test coverage detected
searching dependent graphs…