MCPcopy Create free account
hub / github.com/google/pprof / TestOpenMalformedELF

Function TestOpenMalformedELF

internal/binutils/binutils_test.go:543–555  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

541}
542
543func TestOpenMalformedELF(t *testing.T) {
544 // Test that opening a malformed ELF file will report an error containing
545 // the word "ELF".
546 bu := &Binutils{}
547 _, err := bu.Open(filepath.Join("testdata", "malformed_elf"), 0, 0, 0, "")
548 if err == nil {
549 t.Fatalf("Open: unexpected success")
550 }
551
552 if !strings.Contains(err.Error(), "ELF") {
553 t.Errorf("Open: got %v, want error containing 'ELF'", err)
554 }
555}
556
557func TestOpenMalformedMachO(t *testing.T) {
558 // Test that opening a malformed Mach-O file will report an error containing

Callers

nothing calls this directly

Calls 1

OpenMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…