(t *testing.T)
| 29 | } |
| 30 | |
| 31 | func TestWriteHeader(t *testing.T) { |
| 32 | var buf bytes.Buffer |
| 33 | w := NewWriter(&buf) |
| 34 | w.WriteFileHeader(0x1234, 0x56) |
| 35 | want := []byte{ |
| 36 | 0xd4, 0xc3, 0xb2, 0xa1, 0x02, 0x00, 0x04, 0x00, |
| 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 38 | 0x34, 0x12, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, |
| 39 | } |
| 40 | if got := buf.Bytes(); !bytes.Equal(got, want) { |
| 41 | t.Errorf("buf mismatch:\nwant: %+v\ngot: %+v", want, got) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | func TestWritePacket(t *testing.T) { |
| 46 | ci := gopacket.CaptureInfo{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…