aboutsummaryrefslogtreecommitdiffstats
path: root/syz-verifier/stats_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'syz-verifier/stats_test.go')
-rw-r--r--syz-verifier/stats_test.go27
1 files changed, 19 insertions, 8 deletions
diff --git a/syz-verifier/stats_test.go b/syz-verifier/stats_test.go
index 6cbef81f6..81dc1ef2e 100644
--- a/syz-verifier/stats_test.go
+++ b/syz-verifier/stats_test.go
@@ -14,9 +14,17 @@ func dummyStats() *Stats {
Progs: 24,
TotalMismatches: 10,
Calls: map[string]*CallStats{
- "foo": {"foo", 2, 8, map[ReturnState]bool{{Errno: 1}: true, {Errno: 3}: true}},
- "bar": {"bar", 5, 6, map[ReturnState]bool{{Errno: 10}: true, {Errno: 22}: true}},
- "tar": {"tar", 3, 4, map[ReturnState]bool{{Errno: 5}: true, {Errno: 17}: true, {Errno: 31}: true}},
+ "foo": {"foo", 2, 8, map[ReturnState]bool{
+ returnState(1, 7): true,
+ returnState(3, 7): true}},
+ "bar": {"bar", 5, 6, map[ReturnState]bool{
+ crashedReturnState(): true,
+ returnState(10, 7): true,
+ returnState(22, 7): true}},
+ "tar": {"tar", 3, 4, map[ReturnState]bool{
+ returnState(31, 7): true,
+ returnState(17, 7): true,
+ returnState(5, 7): true}},
"biz": {"biz", 0, 2, map[ReturnState]bool{}},
},
}
@@ -38,7 +46,7 @@ func TestReportCallStats(t *testing.T) {
"\t↳ mismatches of foo / occurrences of foo: 2 / 8 (25.00 %)\n" +
"\t↳ mismatches of foo / total number of mismatches: 2 / 10 (20.00 %)\n" +
"\t↳ 2 distinct states identified: " +
- "[Errno: 1 (operation not permitted)\n Errno: 3 (no such process)\n]\n",
+ "[\"Flags: 7, Errno: 1 (operation not permitted)\" \"Flags: 7, Errno: 3 (no such process)\"]\n",
},
}
@@ -64,18 +72,21 @@ func TestReportGlobalStats(t *testing.T) {
"statistics for bar:\n"+
"\t↳ mismatches of bar / occurrences of bar: 5 / 6 (83.33 %)\n"+
"\t↳ mismatches of bar / total number of mismatches: 5 / 10 (50.00 %)\n"+
- "\t↳ 2 distinct states identified: "+
- "[Errno: 10 (no child processes)\n Errno: 22 (invalid argument)\n]\n\n"+
+ "\t↳ 3 distinct states identified: "+
+ "[\"Crashed\" \"Flags: 7, Errno: 10 (no child processes)\" "+
+ "\"Flags: 7, Errno: 22 (invalid argument)\"]\n\n"+
"statistics for tar:\n"+
"\t↳ mismatches of tar / occurrences of tar: 3 / 4 (75.00 %)\n"+
"\t↳ mismatches of tar / total number of mismatches: 3 / 10 (30.00 %)\n"+
"\t↳ 3 distinct states identified: "+
- "[Errno: 5 (input/output error)\n Errno: 17 (file exists)\n Errno: 31 (too many links)\n]\n\n"+
+ "[\"Flags: 7, Errno: 17 (file exists)\" "+
+ "\"Flags: 7, Errno: 31 (too many links)\" "+
+ "\"Flags: 7, Errno: 5 (input/output error)\"]\n\n"+
"statistics for foo:\n"+
"\t↳ mismatches of foo / occurrences of foo: 2 / 8 (25.00 %)\n"+
"\t↳ mismatches of foo / total number of mismatches: 2 / 10 (20.00 %)\n"+
"\t↳ 2 distinct states identified: "+
- "[Errno: 1 (operation not permitted)\n Errno: 3 (no such process)\n]\n\n"
+ "[\"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)