test: Fixup docs for NodeClockContext and SteadyClockContext

This commit is contained in:
MarcoFalke
2026-02-04 08:17:05 +01:00
parent eeeeb2a0b9
commit faea12ecd9
2 changed files with 9 additions and 7 deletions

View File

@@ -42,8 +42,10 @@ struct CheckGlobalsImpl {
std::cerr << "\n\n"
"The current fuzz target accessed system time.\n\n"
"This is acceptable, but requires the fuzz target to call \n"
"SetMockTime() at the beginning of processing the fuzz input.\n\n"
"This is acceptable, but requires the fuzz target to use \n"
"a NodeClockContext, SteadyClockContext or call \n"
"SetMockTime() at the \n" "beginning of processing the \n"
"fuzz input.\n\n"
"Without setting mock time, time-dependent behavior can lead \n"
"to non-reproducible bugs or inefficient fuzzing.\n\n"

View File

@@ -14,7 +14,8 @@
using namespace std::chrono_literals;
/** Mockable clock in the context of tests, otherwise the system clock */
/// Version of the system clock that is mockable in the context of tests (via
/// NodeClockContext or ::SetMockTime), otherwise the system clock.
struct NodeClock : public std::chrono::system_clock {
using time_point = std::chrono::time_point<NodeClock>;
/** Return current system time or mocked time, if set */
@@ -31,10 +32,9 @@ using SteadyMicroseconds = std::chrono::time_point<std::chrono::steady_clock, st
using SystemClock = std::chrono::system_clock;
/**
* Version of SteadyClock that is mockable in the context of tests (set the
* current value with SetMockTime), otherwise the system steady clock.
*/
/// Version of SteadyClock that is mockable in the context of tests (via
/// SteadyClockContext, or Self::SetMockTime), otherwise the system steady
/// clock.
struct MockableSteadyClock : public std::chrono::steady_clock {
using time_point = std::chrono::time_point<MockableSteadyClock>;