Version: SMASH-3.1
unittest.h File Reference

Go to the source code of this file.

Namespaces

 vir
 
 vir::test
 

Macros

#define TEST(function_name)
 Defines a test function. More...
 
#define TEST_CATCH(function_name, ExceptionType)
 Same as above, but expects the code to throw an exception of type ExceptionType. More...
 
#define TEST_TYPES(T, test_name, typelist)
 Define a test function template, with type parameter T, which is specialized for all types in the typelist. More...
 
#define VERIFY(condition)
 Verifies that condition is true. More...
 
#define COMPARE(test_value, reference)
 Verifies that test_value is equal to reference. More...
 
#define COMPARE_ABSOLUTE_ERROR(test_value, reference, allowed_difference)
 Verifies that the difference between test_value and reference is smaller than allowed_difference. More...
 
#define COMPARE_RELATIVE_ERROR(test_value, reference, allowed_relative_difference)
 Verifies that the difference between test_value and reference is smaller than allowed_relative_difference * reference. More...
 
#define FUZZY_COMPARE(test_value, reference)
 Verifies that test_value is equal to reference within a pre-defined distance in units of least precision (ulp). More...
 
#define FAIL()
 Call this to fail a test. More...
 

Functions

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