OLD | NEW |
1 package parser | 1 package parser |
2 | 2 |
3 import ( | 3 import ( |
4 "math" | 4 "math" |
5 "testing" | 5 "testing" |
6 | 6 |
7 "skia.googlesource.com/buildbot.git/perf/go/config" | 7 "skia.googlesource.com/buildbot.git/perf/go/config" |
8 "skia.googlesource.com/buildbot.git/perf/go/types" | 8 "skia.googlesource.com/buildbot.git/perf/go/types" |
9 ) | 9 ) |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 t.Errorf("ave() returned wrong length: Got %v Want %v", got, wan
t) | 124 t.Errorf("ave() returned wrong length: Got %v Want %v", got, wan
t) |
125 } | 125 } |
126 | 126 |
127 for i, want := range []float64{1.0, 0.5, -2.0, 1e100} { | 127 for i, want := range []float64{1.0, 0.5, -2.0, 1e100} { |
128 if got := traces[0].Values[i]; !near(got, want) { | 128 if got := traces[0].Values[i]; !near(got, want) { |
129 t.Errorf("Distance mismatch: Got %v Want %v", got, want) | 129 t.Errorf("Distance mismatch: Got %v Want %v", got, want) |
130 } | 130 } |
131 } | 131 } |
132 } | 132 } |
133 | 133 |
| 134 func TestRatio(t *testing.T) { |
| 135 ctx := newTestContext() |
| 136 } |
| 137 |
134 func TestFill(t *testing.T) { | 138 func TestFill(t *testing.T) { |
135 ctx := newTestContext() | 139 ctx := newTestContext() |
136 ctx.Tile.Traces["t1"].(*types.PerfTrace).Values = []float64{1e100, 1e100
, 2, 3, 1e100, 5} | 140 ctx.Tile.Traces["t1"].(*types.PerfTrace).Values = []float64{1e100, 1e100
, 2, 3, 1e100, 5} |
137 delete(ctx.Tile.Traces, "t2") | 141 delete(ctx.Tile.Traces, "t2") |
138 traces, err := ctx.Eval(`fill(filter("config=8888"))`) | 142 traces, err := ctx.Eval(`fill(filter("config=8888"))`) |
139 if err != nil { | 143 if err != nil { |
140 t.Fatalf("Failed to eval fill() test: %s", err) | 144 t.Fatalf("Failed to eval fill() test: %s", err) |
141 } | 145 } |
142 if got, want := len(traces), 1; got != want { | 146 if got, want := len(traces), 1; got != want { |
143 t.Errorf("fill() returned wrong length: Got %v Want %v", got, wa
nt) | 147 t.Errorf("fill() returned wrong length: Got %v Want %v", got, wa
nt) |
144 } | 148 } |
145 | 149 |
146 for i, want := range []float64{2, 2, 2, 3, 3, 5} { | 150 for i, want := range []float64{2, 2, 2, 3, 3, 5} { |
147 if got := traces[0].Values[i]; !near(got, want) { | 151 if got := traces[0].Values[i]; !near(got, want) { |
148 t.Errorf("Distance mismatch: Got %v Want %v", got, want) | 152 t.Errorf("Distance mismatch: Got %v Want %v", got, want) |
149 } | 153 } |
150 } | 154 } |
151 } | 155 } |
OLD | NEW |