tap: add expect_nan function
This commit is contained in:
parent
e0636a5b5e
commit
54f5f2d170
4
tap.hpp
4
tap.hpp
@ -52,6 +52,10 @@ namespace util { namespace TAP {
|
||||
template <typename T, typename U> void expect_lt (const T&, const U&, const std::string &msg = "lt");
|
||||
template <typename T, typename U> void expect_le (const T&, const U&, const std::string &msg = "le");
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
template <typename T> void expect_nan (const T&, const std::string &msg = "nan");
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
void skip (const std::string &msg);
|
||||
void todo (const std::string &msg);
|
||||
void noop (void);
|
||||
|
10
tap.ipp
10
tap.ipp
@ -77,3 +77,13 @@ TAP_TEST(lt, < )
|
||||
TAP_TEST(le, <=)
|
||||
|
||||
#undef TAP_TEST
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
void
|
||||
util::TAP::logger::expect_nan (const T &t, const std::string &msg)
|
||||
{
|
||||
bool(*func)(T) = std::isnan;
|
||||
expect<const T&> (func, t, msg);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user