The following list contains the available options for asserting with the Catch framework:
- Use CHECK(expr) to check whether expr evaluates to true, continuing the execution in case of failure, and REQUIRE(expr) to make sure that expr evaluates to true and stop the execution of the test in case of failure:
int a = 42; CHECK(a == 42); REQUIRE(a == 42);
- Use CHECK_FALSE(expr) and REQUIRE_FALSE(expr) to make sure that expr evaluates to false and produce either a non-fatal or fatal error in case of failure:
int a = 42; CHECK_FALSE(a > 100); REQUIRE_FALSE(a > 100);
- Use the Approx class to compare floating point values with a given approximation. The method epsilon() sets a maximum percentage (as a value between 0 and 1) by ...