aboutsummaryrefslogtreecommitdiffstats
path: root/syz-verifier/utils_test.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2022-03-31 14:48:05 +0200
committerGitHub <noreply@github.com>2022-03-31 14:48:05 +0200
commit68fc921ad90a9ed3604448913e66d02ea8d11de6 (patch)
tree836206fbeadbdfcb9fc9071f7681d079e8210e33 /syz-verifier/utils_test.go
parentc4c32d8c774cb19ca838765ca4ddf38ab8dc0ddb (diff)
syz-verifier: fix stats access, remove races
Removed atomic operations. Added object level mutex.
Diffstat (limited to 'syz-verifier/utils_test.go')
-rw-r--r--syz-verifier/utils_test.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/syz-verifier/utils_test.go b/syz-verifier/utils_test.go
index 04888ec5e..36bec3f74 100644
--- a/syz-verifier/utils_test.go
+++ b/syz-verifier/utils_test.go
@@ -64,16 +64,18 @@ func makeExecResultCrashed(pool int) *ExecResult {
}
func emptyTestStats() *Stats {
- return &Stats{
- Calls: map[string]*CallStats{
- "breaks_returns": {Name: "breaks_returns", States: map[ReturnState]bool{}},
- "minimize$0": {Name: "minimize$0", States: map[ReturnState]bool{}},
- "test$res0": {Name: "test$res0", States: map[ReturnState]bool{}},
+ return (&Stats{
+ Calls: StatMapStringToCallStats{
+ mapStringToCallStats: mapStringToCallStats{
+ "breaks_returns": {Name: "breaks_returns", States: map[ReturnState]bool{}},
+ "minimize$0": {Name: "minimize$0", States: map[ReturnState]bool{}},
+ "test$res0": {Name: "test$res0", States: map[ReturnState]bool{}},
+ },
},
- }
+ }).Init()
}
-func makeCallStats(name string, occurrences, mismatches int64, states map[ReturnState]bool) *CallStats {
+func makeCallStats(name string, occurrences, mismatches uint64, states map[ReturnState]bool) *CallStats {
return &CallStats{Name: name,
Occurrences: occurrences,
Mismatches: mismatches,