5#ifndef BITCOIN_TEST_UTIL_COMMON_H
6#define BITCOIN_TEST_UTIL_COMMON_H
23 bool operator()(
const std::exception&
e)
const {
return (*
this)(
e.what()); }
31template <
typename Clock,
typename Duration>
32inline std::ostream&
operator<<(std::ostream&
os,
const std::chrono::time_point<Clock, Duration>&
tp)
34 return os <<
tp.time_since_epoch().count();
37template <
typename T>
requires std::is_enum_v<T>
44inline std::ostream&
operator<<(std::ostream&
os,
const std::optional<T>& v)
47 :
os <<
"std::nullopt";
54template <HasToString T>
57 return os <<
obj.ToString();
BOOST_CHECK_EXCEPTION predicates to check the specific validation error.
bool operator()(std::string_view s) const
const std::string m_reason
bool operator()(const std::exception &e) const
HasReason(std::string_view reason)
#define T(expected, seed, data)
std::ostream & operator<<(std::ostream &os, const std::chrono::time_point< Clock, Duration > &tp)
std::ostream & operator<<(std::ostream &os, const T &obj)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.