| 995 | } |
| 996 | |
| 997 | func TestNormalizeBySameProfile(t *testing.T) { |
| 998 | pb := testProfile1.Copy() |
| 999 | p := testProfile1.Copy() |
| 1000 | |
| 1001 | if err := p.Normalize(pb); err != nil { |
| 1002 | t.Fatal(err) |
| 1003 | } |
| 1004 | |
| 1005 | for i, s := range p.Sample { |
| 1006 | for j, v := range s.Value { |
| 1007 | expectedSampleValue := testProfile1.Sample[i].Value[j] |
| 1008 | if v != expectedSampleValue { |
| 1009 | t.Errorf("For sample %d, value %d want %d got %d", i, j, expectedSampleValue, v) |
| 1010 | } |
| 1011 | } |
| 1012 | } |
| 1013 | } |
| 1014 | |
| 1015 | func TestNormalizeByDifferentProfile(t *testing.T) { |
| 1016 | p := testProfile1.Copy() |