Changeset View
Changeset View
Standalone View
Standalone View
src/test/util/setup_common.h
Show All 24 Lines | |||||
* Version of Boost::test prior to 1.64 have issues when dealing with nullptr_t. | * Version of Boost::test prior to 1.64 have issues when dealing with nullptr_t. | ||||
* In order to work around this, we ensure that the null pointers are typed in a | * In order to work around this, we ensure that the null pointers are typed in a | ||||
* way that Boost will like better. | * way that Boost will like better. | ||||
* | * | ||||
* TODO: Use nullptr directly once the minimum version of boost is 1.64 or more. | * TODO: Use nullptr directly once the minimum version of boost is 1.64 or more. | ||||
*/ | */ | ||||
#define NULLPTR(T) static_cast<T *>(nullptr) | #define NULLPTR(T) static_cast<T *>(nullptr) | ||||
/** This is connected to the logger. Can be used to redirect logs to any other | |||||
* log */ | |||||
extern const std::function<void(const std::string &)> G_TEST_LOG_FUN; | |||||
// Enable BOOST_CHECK_EQUAL for enum class types | // Enable BOOST_CHECK_EQUAL for enum class types | ||||
template <typename T> | template <typename T> | ||||
std::ostream &operator<<( | std::ostream &operator<<( | ||||
typename std::enable_if<std::is_enum<T>::value, std::ostream>::type &stream, | typename std::enable_if<std::is_enum<T>::value, std::ostream>::type &stream, | ||||
const T &e) { | const T &e) { | ||||
return stream << static_cast<typename std::underlying_type<T>::type>(e); | return stream << static_cast<typename std::underlying_type<T>::type>(e); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 179 Lines • Show Last 20 Lines |