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

Function TestCreateNodes

internal/graph/graph_test.go:403–420  ·  view source on GitHub ↗

TestCreateNodes checks that nodes are properly created for a simple profile.

(t *testing.T)

Source from the content-addressed store, hash-verified

401
402// TestCreateNodes checks that nodes are properly created for a simple profile.
403func TestCreateNodes(t *testing.T) {
404 testProfile := nodeTestProfile()
405 wantNodeSet := NodeSet{
406 {Name: "symname"}: true,
407 {Objfile: "unsymbolized_library_1"}: true,
408 {Objfile: "unsymbolized_library_2"}: true,
409 }
410
411 nodes, _ := CreateNodes(testProfile, &Options{})
412 if len(nodes) != len(wantNodeSet) {
413 t.Errorf("got %d nodes, want %d", len(nodes), len(wantNodeSet))
414 }
415 for _, node := range nodes {
416 if !wantNodeSet[node.Info] {
417 t.Errorf("unexpected node %v", node.Info)
418 }
419 }
420}
421
422func TestShortenFunctionName(t *testing.T) {
423 type testCase struct {

Callers

nothing calls this directly

Calls 2

nodeTestProfileFunction · 0.85
CreateNodesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…