diff options
Diffstat (limited to 'syz-verifier/stats_test.go')
| -rw-r--r-- | syz-verifier/stats_test.go | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/syz-verifier/stats_test.go b/syz-verifier/stats_test.go index 38f4f4661..e553e3827 100644 --- a/syz-verifier/stats_test.go +++ b/syz-verifier/stats_test.go @@ -3,7 +3,6 @@ package main import ( - "bytes" "testing" "github.com/google/go-cmp/cmp" @@ -32,7 +31,7 @@ func dummyStats() *Stats { } } -func TestReportCallStats(t *testing.T) { +func TestGetCallStatsTextDescription(t *testing.T) { tests := []struct { name, call, report string }{ @@ -55,19 +54,18 @@ func TestReportCallStats(t *testing.T) { for _, test := range tests { s := dummyStats() t.Run(test.name, func(t *testing.T) { - got, want := s.ReportCallStats(test.call), test.report + got, want := s.getCallStatsTextDescription(test.call), test.report if diff := cmp.Diff(want, got); diff != "" { - t.Errorf("s.ReportCallStats mismatch (-want +got):\n%s", diff) + t.Errorf("s.getCallStatsTextDescription mismatch (-want +got):\n%s", diff) } }) } } -func TestReportGlobalStats(t *testing.T) { - s := dummyStats() - out := bytes.Buffer{} - s.ReportGlobalStats(&out, float64(10)) - got, want := out.String(), +func TestGetTextDescription(t *testing.T) { + stats := dummyStats() + + got, want := stats.GetTextDescription(float64(10)), "total number of mismatches / total number of calls "+ "executed: 10 / 20 (50.00 %)\n\n"+ "programs / minute: 2.40\n\n"+ @@ -93,6 +91,6 @@ func TestReportGlobalStats(t *testing.T) { "[\"Flags: 7, Errno: 1 (operation not permitted)\" \"Flags: 7, Errno: 3 (no such process)\"]\n\n" if diff := cmp.Diff(want, got); diff != "" { - t.Errorf("s.ReportGlobalStats mismatch (-want +got):\n%s", diff) + t.Errorf("s.GetTextDescription mismatch (-want +got):\n%s", diff) } } |
