kaycxx-test
C++ unit test framework
Loading...
Searching...
No Matches
assert_not_close

Asserts that two numeric values are not equal after rounding to a decimal precision.

The default precision is 2 decimal digits. Integral values are compared exactly. Boolean values are rejected because closeness is a numeric relation, not a truth-value relation.

#include <kaycxx/test.hpp>
using namespace kaycxx::test;
int main() {
assert_not_close(1.23, 1.24);
assert_not_close(3.14159, 3.15, 3);
}
Unit test framework functions and types.
Definition test.hpp:15
Includes the complete public test API.

Use this when rounded equality would indicate an unwanted result.