diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-04-07 11:03:26 +0200 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2021-04-15 08:19:49 +0200 |
commit | 9668e43d8e757c0185b900eb6ee6891a0ba41666 (patch) | |
tree | ec0b4dc23d942d61103a7fc1b8351a4304daf700 /src/test | |
parent | 0c90ff1429deaa556c0509c13cdd5aef5df9c0d4 (diff) |
fuzz: make FuzzedSock::Wait() sometimes simulate an occurred event
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/fuzz/util.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/fuzz/util.cpp b/src/test/fuzz/util.cpp index 9ab7145b8a..d16c5afac7 100644 --- a/src/test/fuzz/util.cpp +++ b/src/test/fuzz/util.cpp @@ -18,7 +18,9 @@ bool FuzzedSock::Wait(std::chrono::milliseconds timeout, Event requested, Event* SetFuzzedErrNo(m_fuzzed_data_provider, wait_errnos); return false; } - if (occurred) *occurred = 0; + if (occurred != nullptr) { + *occurred = m_fuzzed_data_provider.ConsumeBool() ? requested : 0; + } return true; } |