From faea12ecd9fe026876a3278782a9320934214905 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 4 Feb 2026 08:17:05 +0100 Subject: [PATCH] test: Fixup docs for NodeClockContext and SteadyClockContext --- src/test/fuzz/util/check_globals.cpp | 6 ++++-- src/util/time.h | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/test/fuzz/util/check_globals.cpp b/src/test/fuzz/util/check_globals.cpp index f91a965afce..ca3111534d3 100644 --- a/src/test/fuzz/util/check_globals.cpp +++ b/src/test/fuzz/util/check_globals.cpp @@ -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" diff --git a/src/util/time.h b/src/util/time.h index 59abc4d5a7f..967ea780aaf 100644 --- a/src/util/time.h +++ b/src/util/time.h @@ -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; /** Return current system time or mocked time, if set */ @@ -31,10 +32,9 @@ using SteadyMicroseconds = std::chrono::time_point;