TestCreateNodes checks that nodes are properly created for a simple profile.
(t *testing.T)
| 401 | |
| 402 | // TestCreateNodes checks that nodes are properly created for a simple profile. |
| 403 | func 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 | |
| 422 | func TestShortenFunctionName(t *testing.T) { |
| 423 | type testCase struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…