(t *testing.T)
| 392 | } |
| 393 | |
| 394 | func TestComputeTotal(t *testing.T) { |
| 395 | p1 := testProfile.Copy() |
| 396 | p1.Sample = []*profile.Sample{ |
| 397 | { |
| 398 | Location: []*profile.Location{testL[0]}, |
| 399 | Value: []int64{1, 1}, |
| 400 | }, |
| 401 | { |
| 402 | Location: []*profile.Location{testL[2], testL[1], testL[0]}, |
| 403 | Value: []int64{1, 10}, |
| 404 | }, |
| 405 | { |
| 406 | Location: []*profile.Location{testL[4], testL[2], testL[0]}, |
| 407 | Value: []int64{1, 100}, |
| 408 | }, |
| 409 | } |
| 410 | |
| 411 | p2 := testProfile.Copy() |
| 412 | p2.Sample = []*profile.Sample{ |
| 413 | { |
| 414 | Location: []*profile.Location{testL[0]}, |
| 415 | Value: []int64{1, 1}, |
| 416 | }, |
| 417 | { |
| 418 | Location: []*profile.Location{testL[2], testL[1], testL[0]}, |
| 419 | Value: []int64{1, -10}, |
| 420 | }, |
| 421 | { |
| 422 | Location: []*profile.Location{testL[4], testL[2], testL[0]}, |
| 423 | Value: []int64{1, 100}, |
| 424 | }, |
| 425 | } |
| 426 | |
| 427 | p3 := testProfile.Copy() |
| 428 | p3.Sample = []*profile.Sample{ |
| 429 | { |
| 430 | Location: []*profile.Location{testL[0]}, |
| 431 | Value: []int64{10000, 1}, |
| 432 | }, |
| 433 | { |
| 434 | Location: []*profile.Location{testL[2], testL[1], testL[0]}, |
| 435 | Value: []int64{-10, 3}, |
| 436 | Label: map[string][]string{"pprof::base": {"true"}}, |
| 437 | }, |
| 438 | { |
| 439 | Location: []*profile.Location{testL[2], testL[1], testL[0]}, |
| 440 | Value: []int64{1000, -10}, |
| 441 | }, |
| 442 | { |
| 443 | Location: []*profile.Location{testL[2], testL[1], testL[0]}, |
| 444 | Value: []int64{-9000, 3}, |
| 445 | Label: map[string][]string{"pprof::base": {"true"}}, |
| 446 | }, |
| 447 | { |
| 448 | Location: []*profile.Location{testL[2], testL[1], testL[0]}, |
| 449 | Value: []int64{-1, 3}, |
| 450 | Label: map[string][]string{"pprof::base": {"true"}}, |
| 451 | }, |
nothing calls this directly
no test coverage detected
searching dependent graphs…