test: Allow time_point in boost checks

This is required in the next commit.
This commit is contained in:
MarcoFalke
2025-05-07 00:57:44 +02:00
parent f80bf5128d
commit fa9f434df8

View File

@@ -5,8 +5,9 @@
#ifndef BITCOIN_TEST_UTIL_COMMON_H
#define BITCOIN_TEST_UTIL_COMMON_H
#include <ostream>
#include <chrono>
#include <optional>
#include <ostream>
#include <string>
/**
@@ -27,6 +28,12 @@ private:
// Make types usable in BOOST_CHECK_* @{
namespace std {
template <typename Clock, typename Duration>
inline std::ostream& operator<<(std::ostream& os, const std::chrono::time_point<Clock, Duration>& tp)
{
return os << tp.time_since_epoch().count();
}
template <typename T> requires std::is_enum_v<T>
inline std::ostream& operator<<(std::ostream& os, const T& e)
{