MCPcopy Index your code
hub / github.com/google/gopacket / TestPcapNonexistentFile

Function TestPcapNonexistentFile

pcap/pcap_test.go:21–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestPcapNonexistentFile(t *testing.T) {
22 handle, err := OpenOffline("/path/to/nonexistent/file")
23 if err == nil {
24 t.Error("No error returned for nonexistent file open")
25 } else {
26 t.Logf("Error returned for nonexistent file: %v", err)
27 }
28 if handle != nil {
29 t.Error("Non-nil handle returned for nonexistent file open")
30 }
31}
32
33func TestPcapFileRead(t *testing.T) {
34 invalidData := []byte{

Callers

nothing calls this directly

Calls 2

OpenOfflineFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…