test: Use NodeClockContext in more tests

This commit is contained in:
MarcoFalke
2025-05-07 02:04:48 +02:00
parent fa8fe0941e
commit faad08e59c
11 changed files with 57 additions and 55 deletions

View File

@@ -3,7 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <bench/bench.h>
#include <test/util/time.h>
#include <util/time.h>
static void BenchTimeDeprecated(benchmark::Bench& bench)
@@ -15,11 +15,10 @@ static void BenchTimeDeprecated(benchmark::Bench& bench)
static void BenchTimeMock(benchmark::Bench& bench)
{
SetMockTime(111);
NodeClockContext clock_ctx{111s};
bench.run([&] {
(void)GetTime<std::chrono::seconds>();
});
SetMockTime(0);
}
static void BenchTimeMillis(benchmark::Bench& bench)