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

Function checkSymbol

internal/binutils/disasm_test.go:74–100  ·  view source on GitHub ↗
(got []*plugin.Sym, want []plugin.Sym)

Source from the content-addressed store, hash-verified

72}
73
74func checkSymbol(got []*plugin.Sym, want []plugin.Sym) error {
75 if len(got) != len(want) {
76 return fmt.Errorf("unexpected number of symbols %d (want %d)", len(got), len(want))
77 }
78
79 for i, g := range got {
80 w := want[i]
81 if len(g.Name) != len(w.Name) {
82 return fmt.Errorf("names, got %d, want %d", len(g.Name), len(w.Name))
83 }
84 for n := range g.Name {
85 if g.Name[n] != w.Name[n] {
86 return fmt.Errorf("name %d, got %q, want %q", n, g.Name[n], w.Name[n])
87 }
88 }
89 if g.File != w.File {
90 return fmt.Errorf("filename, got %q, want %q", g.File, w.File)
91 }
92 if g.Start != w.Start {
93 return fmt.Errorf("start address, got %#x, want %#x", g.Start, w.Start)
94 }
95 if g.End != w.End {
96 return fmt.Errorf("end address, got %#x, want %#x", g.End, w.End)
97 }
98 }
99 return nil
100}
101
102// TestFunctionAssembly tests the FunctionAssembly routine by using a
103// fake objdump script.

Callers 1

TestFindSymbolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…