OLD | NEW |
1 package data | 1 package data |
2 | 2 |
3 import ( | 3 import ( |
4 "reflect" | 4 "reflect" |
5 "testing" | 5 "testing" |
6 | 6 |
7 "go.skia.org/infra/fuzzer/go/common" | 7 "go.skia.org/infra/fuzzer/go/common" |
8 ) | 8 ) |
9 | 9 |
10 func TestSortedFuzzReports(t *testing.T) { | 10 func TestSortedFuzzReports(t *testing.T) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 for _, key := range addingOrder { | 51 for _, key := range addingOrder { |
52 builder.addFuzzReport("skpicture", mockPictureDetails[key]) | 52 builder.addFuzzReport("skpicture", mockPictureDetails[key]) |
53 } | 53 } |
54 addingOrder = []string{"iiii", "hhhh"} | 54 addingOrder = []string{"iiii", "hhhh"} |
55 for _, key := range addingOrder { | 55 for _, key := range addingOrder { |
56 builder.addFuzzReport("api", mockAPIDetails[key]) | 56 builder.addFuzzReport("api", mockAPIDetails[key]) |
57 } | 57 } |
58 return builder | 58 return builder |
59 } | 59 } |
60 | 60 |
61 func TestSummary(t *testing.T) { | |
62 builder := loadReports() | |
63 | |
64 summary := builder.getSummarySortedByTotal("skpicture") | |
65 if !reflect.DeepEqual(expectedPictureSummary, summary) { | |
66 t.Errorf("Summary Report Expected: %#v\n, but was: %#v", expecte
dPictureSummary, summary) | |
67 } | |
68 | |
69 summary = builder.getSummarySortedByTotal("api") | |
70 if !reflect.DeepEqual(expectedAPISummary, summary) { | |
71 t.Errorf("Summary Report Expected: %#v\n, but was: %#v", expecte
dAPISummary, summary) | |
72 } | |
73 } | |
74 | |
75 func makeStacktrace(file, function string, line int) StackTrace { | 61 func makeStacktrace(file, function string, line int) StackTrace { |
76 return StackTrace{ | 62 return StackTrace{ |
77 Frames: []StackTraceFrame{ | 63 Frames: []StackTraceFrame{ |
78 { | 64 { |
79 PackageName: "mock/package/", | 65 PackageName: "mock/package/", |
80 FileName: file, | 66 FileName: file, |
81 LineNumber: line, | 67 LineNumber: line, |
82 FunctionName: function, | 68 FunctionName: function, |
83 }, | 69 }, |
84 }, | 70 }, |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 FunctionFuzzReport{ | 252 FunctionFuzzReport{ |
267 FunctionName: "beta", Count: 2, LineNumbers: []L
ineFuzzReport{ | 253 FunctionName: "beta", Count: 2, LineNumbers: []L
ineFuzzReport{ |
268 LineFuzzReport{ | 254 LineFuzzReport{ |
269 LineNumber: 16, Count: 2, Detail
s: nil, | 255 LineNumber: 16, Count: 2, Detail
s: nil, |
270 }, | 256 }, |
271 }, | 257 }, |
272 }, | 258 }, |
273 }, | 259 }, |
274 }, | 260 }, |
275 } | 261 } |
OLD | NEW |