Version: SMASH-3.1
vir::test Namespace Reference

Functions

template<class F >
void expect_assert_failure (F &&f)
 Pass code that should fail an assertion to this function. More...
 
void expect_failure ()
 Use this to mark that the failure of a following test is expected. More...
 

Function Documentation

◆ expect_assert_failure()

template<class F >
void vir::test::expect_assert_failure ( F &&  f)
inline

Pass code that should fail an assertion to this function.

◆ expect_failure()

void vir::test::expect_failure ( )
inline

Use this to mark that the failure of a following test is expected.

TEST(something) {
// this needs to pass
VERIFY(true);
// if this fails, the test will be marked "XFAIL" and the failure
// will not be counted
VERIFY(false);
// this will not be checked anymore, because the TEST stops at the
// (expectedly) failing VERIFY.
VERIFY(true);
}
#define TEST(function_name)
Defines a test function.
Definition: unittest.h:234
#define VERIFY(condition)
Verifies that condition is true.
Definition: unittest.h:254
void expect_failure()
Use this to mark that the failure of a following test is expected.