xtd 0.2.0
Loading...
Searching...
No Matches

◆ is_NaN_

#define is_NaN_ (   ...)

#include <xtd.tunit/include/xtd/tunit/assert.h>

Asserts that a value is NaN.

Parameters
valueThe value to check is NaN.
messageAn optional user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Contains information about current file and current line.
Can be used with xtd::tunit::assert, xtd::tunit::assume and xtd::tunit::valid classes.
Examples
double v1 = std::numeric_limits<double>::quiet_NaN();
double v2 = 3.14159265358979323846;
xtd::tunit::assert::is_NaN_(v1); // test ok.
xtd::tunit::assert::is_NaN_(v2, "User message..."); // test error.
xtd::tunit::assume::is_NaN_(v1); // test ok.
xtd::tunit::assume::is_NaN_(v2, "User message..."); // test error.
xtd::tunit::valid::is_NaN_(v1); // test ok.
xtd::tunit::valid::is_NaN_(v2, "User message..."); // test error.