tunit - Reference Guide  1.0.0
Modern c++17 unit testing framework on Windows, macOS, Linux, iOS and android.
tunit::assume Class Referencefinal

The assert class contains a collection of static methods that implement the most common assertions used in tUnit. More...

#include <assume.h>

Inheritance diagram for tunit::assume:
Collaboration diagram for tunit::assume:

Static Public Member Functions

template<typename TExpected , typename TActual >
static void are_equal (const TExpected &expected, const TActual &actual)
 Assumes that two type are equal. More...
 
template<typename TExpected , typename TActual >
static void are_equal (const TExpected &expected, const TActual &actual, const tunit::line_info &line_info)
 Assumes that two type are equal. More...
 
template<typename TExpected , typename TActual >
static void are_equal (const TExpected &expected, const TActual &actual, const std::string &message)
 Assumes that two type are equal. More...
 
template<typename TExpected , typename TActual >
static void are_equal (const TExpected &expected, const TActual &actual, const std::string &message, const tunit::line_info &line_info)
 Assumes that two type are equal. More...
 
static void are_equal (float expected, float actual, float tolerance)
 Assumes that two type are equal. More...
 
static void are_equal (float expected, float actual, float tolerance, const tunit::line_info &line_info)
 Assumes that two type are equal. More...
 
static void are_equal (float expected, float &actual, float tolerance, const std::string &message)
 Assumes that two type are equal. More...
 
static void are_equal (float expected, float actual, float tolerance, const std::string &message, const tunit::line_info &line_info)
 Assumes that two type are equal. More...
 
static void are_equal (double expected, double actual, double tolerance)
 Assumes that two type are equal. More...
 
static void are_equal (double expected, double actual, double tolerance, const tunit::line_info &line_info)
 Assumes that two type are equal. More...
 
static void are_equal (double expected, double actual, double tolerance, const std::string &message)
 Assumes that two type are equal. More...
 
static void are_equal (double expected, double actual, double tolerance, const std::string &message, const tunit::line_info &line_info)
 Assumes that two type are equal. More...
 
static void are_equal (long double expected, long double actual, long double tolerance)
 Assumes that two type are equal. More...
 
static void are_equal (long double expected, long double actual, long double tolerance, const tunit::line_info &line_info)
 Assumes that two type are equal. More...
 
static void are_equal (long double expected, long double actual, long double tolerance, const std::string &message)
 Assumes that two type are equal. More...
 
static void are_equal (long double expected, long double actual, long double tolerance, const std::string &message, const tunit::line_info &line_info)
 Assumes that two type are equal. More...
 
template<typename TExpected , typename TActual >
static void are_not_equal (const TExpected &expected, const TActual &actual)
 Assumes that two type are not equal. More...
 
template<typename TExpected , typename TActual >
static void are_not_equal (const TExpected &expected, const TActual &actual, const tunit::line_info &line_info)
 Assumes that two type are not equal. More...
 
template<typename TExpected , typename TActual >
static void are_not_equal (const TExpected &expected, const TActual &actual, const std::string &message)
 Assumes that two type are not equal. More...
 
template<typename TExpected , typename TActual >
static void are_not_equal (const TExpected &expected, const TActual &actual, const std::string &message, const tunit::line_info &line_info)
 Assumes that two type are not equal. More...
 
template<typename TExpected , typename TActual >
static void are_not_same (const TExpected &expected, const TActual &actual)
 Assumes that two objects do refer to differents objects. More...
 
template<typename TExpected , typename TActual >
static void are_not_same (const TExpected &expected, const TActual &actual, const tunit::line_info &line_info)
 Assumes that two objects do refer to differents objects. More...
 
template<typename TExpected , typename TActual >
static void are_not_same (const TExpected &expected, const TActual &actual, const std::string &message)
 Assumes that two objects do refer to differents objects. More...
 
template<typename TExpected , typename TActual >
static void are_not_same (const TExpected &expected, const TActual &actual, const std::string &message, const tunit::line_info &line_info)
 Assumes that two objects do refer to differents objects. More...
 
template<typename TExpected , typename TActual >
static void are_same (const TExpected &expected, const TActual &actual)
 Assumes that two objects do refer to differents objects. More...
 
template<typename TExpected , typename TActual >
static void are_same (const TExpected &expected, const TActual &actual, const tunit::line_info &line_info)
 Assumes that two objects do refer to differents objects. More...
 
template<typename TExpected , typename TActual >
static void are_same (const TExpected &expected, const TActual &actual, const std::string &message)
 Assumes that two objects do refer to differents objects. More...
 
template<typename TExpected , typename TActual >
static void are_same (const TExpected &expected, const TActual &actual, const std::string &message, const tunit::line_info &line_info)
 Assumes that two objects do refer to differents objects. More...
 
template<typename TItem , typename TCollection >
static void contains (const TItem &item, const TCollection &collection)
 Assumes that collection contains an item. More...
 
template<typename TItem , typename TCollection >
static void contains (const TItem &item, const TCollection &collection, const tunit::line_info &line_info)
 Assumes that collection contains an item. More...
 
template<typename TItem , typename TCollection >
static void contains (const TItem &item, const TCollection &collection, const std::string &message)
 Assumes that collection contains an item. More...
 
template<typename TItem , typename TCollection >
static void contains (const TItem &item, const TCollection &collection, const std::string &message, const tunit::line_info &line_info)
 Assumes that collection contains an item. More...
 
static void does_not_throw (const std::function< void()> &statement)
 Assumes that the staement does not throw an exception. More...
 
static void does_not_throw (const std::function< void()> &statement, const tunit::line_info &line_info)
 Assumes that the staement does not throw an exception. More...
 
static void does_not_throw (const std::function< void()> &statement, const std::string &message)
 Assumes that the staement does not throw an exception. More...
 
static void does_not_throw (const std::function< void()> &statement, const std::string &message, const tunit::line_info &line_info)
 Assumes that the staement does not throw an exception. More...
 
template<typename TValue >
static void is_empty (const TValue &value)
 Assumes that collection contains an item. More...
 
template<typename TValue >
static void is_empty (const TValue &value, const tunit::line_info &line_info)
 Assumes that collection contains an item. More...
 
template<typename TValue >
static void is_empty (const TValue &value, const std::string &message)
 Assumes that collection contains an item. More...
 
template<typename TValue >
static void is_empty (const TValue &value, const std::string &message, const tunit::line_info &line_info)
 Assumes that collection contains an item. More...
 
template<typename TValue1 , typename TValue2 >
static void is_greater_or_equal (const TValue1 &val1, const TValue2 &val2)
 Assumes that the first value is greater than or equal to the second value. More...
 
template<typename TValue1 , typename TValue2 >
static void is_greater_or_equal (const TValue1 &val1, const TValue2 &val2, const tunit::line_info &line_info)
 Assumes that the first value is greater than or equal to the second value. More...
 
template<typename TValue1 , typename TValue2 >
static void is_greater_or_equal (const TValue1 &val1, const TValue2 &val2, const std::string &message)
 Assumes that the first value is greater than or equal to the second value. More...
 
template<typename TValue1 , typename TValue2 >
static void is_greater_or_equal (const TValue1 &val1, const TValue2 &val2, const std::string &message, const tunit::line_info &line_info)
 Assumes that the first value is greater than or equal to the second value. More...
 
template<typename Type , typename TValue >
static void is_instance_of (const TValue &value)
 Assumes that an object is of the type supplied or a derived type. More...
 
template<typename Type , typename TValue >
static void is_instance_of (const TValue &value, const tunit::line_info &line_info)
 Assumes that an object is of the type supplied or a derived type. More...
 
template<typename Type , typename TValue >
static void is_instance_of (const TValue &value, const std::string &message)
 Assumes that an object is of the type supplied or a derived type. More...
 
template<typename Type , typename TValue >
static void is_instance_of (const TValue &value, const std::string &message, const tunit::line_info &line_info)
 Assumes that an object is of the type supplied or a derived type. More...
 
template<typename TValue1 , typename TValue2 >
static void is_less (const TValue1 &val1, const TValue2 &val2)
 Assumes that the first value is is_less than the second value. More...
 
template<typename TValue1 , typename TValue2 >
static void is_less (const TValue1 &val1, const TValue2 &val2, const tunit::line_info &line_info)
 Assumes that the first value is is_less than the second value. More...
 
template<typename TValue1 , typename TValue2 >
static void is_less (const TValue1 &val1, const TValue2 &val2, const std::string &message)
 Assumes that the first value is is_less than the second value. More...
 
template<typename TValue1 , typename TValue2 >
static void is_less (const TValue1 &val1, const TValue2 &val2, const std::string &message, const tunit::line_info &line_info)
 Assumes that the first value is is_less than the second value. More...
 
template<typename TValue1 , typename TValue2 >
static void is_less_or_equal (const TValue1 &val1, const TValue2 &val2)
 Assumes that the first value is is_less than or equal to the second value. More...
 
template<typename TValue1 , typename TValue2 >
static void is_less_or_equal (const TValue1 &val1, const TValue2 &val2, const tunit::line_info &line_info)
 Assumes that the first value is is_less than or equal to the second value. More...
 
template<typename TValue1 , typename TValue2 >
static void is_less_or_equal (const TValue1 &val1, const TValue2 &val2, const std::string &message)
 Assumes that the first value is is_less than or equal to the second value. More...
 
template<typename TValue1 , typename TValue2 >
static void is_less_or_equal (const TValue1 &val1, const TValue2 &val2, const std::string &message, const tunit::line_info &line_info)
 Assumes that the first value is is_less than or equal to the second value. More...
 
static void is_NaN (double value)
 that a value is NaN. More...
 
static void is_NaN (double value, const tunit::line_info &line_info)
 that a value is NaN. More...
 
static void is_NaN (double value, const std::string &message)
 Assumes that a value is NaN. More...
 
static void is_NaN (double value, const std::string &message, const tunit::line_info &line_info)
 Assumes that a value is NaN. More...
 
static void is_NaN (long double value)
 that a value is NaN. More...
 
static void is_NaN (long double value, const tunit::line_info &line_info)
 that a value is NaN. More...
 
static void is_NaN (long double value, const std::string &message)
 Assumes that a value is NaN. More...
 
static void is_NaN (long double value, const std::string &message, const tunit::line_info &line_info)
 Assumes that a value is NaN. More...
 
static void is_NaN (float value)
 that a value is NaN. More...
 
static void is_NaN (float value, const tunit::line_info &line_info)
 that a value is NaN. More...
 
static void is_NaN (float value, const std::string &message)
 Assumes that a value is NaN. More...
 
static void is_NaN (float value, const std::string &message, const tunit::line_info &line_info)
 Assumes that a value is NaN. More...
 
template<typename TValue >
static void is_negative (const TValue &value)
 Assumes that ta condition is negative. More...
 
template<typename TValue >
static void is_negative (const TValue &value, const tunit::line_info &line_info)
 Assumes that ta condition is negative. More...
 
template<typename TValue >
static void is_negative (const TValue &value, const std::string &message)
 Assumes that ta condition is negative. More...
 
template<typename TValue >
static void is_negative (const TValue &value, const std::string &message, const tunit::line_info &line_info)
 Assumes that ta condition is negative. More...
 
template<typename TValue >
static void is_not_empty (const TValue &value)
 Assumes that collection oes not contain any item. More...
 
template<typename TValue >
static void is_not_empty (const TValue &value, const tunit::line_info &line_info)
 Assumes that collection does not contain any item. More...
 
template<typename TValue >
static void is_not_empty (const TValue &value, const std::string &message)
 Assumes that collection does not contain any item. More...
 
template<typename TValue >
static void is_not_empty (const TValue &value, const std::string &message, const tunit::line_info &line_info)
 Assumes that collection does not contain any item. More...
 
template<typename Type , typename TValue >
static void is_not_instance_of (const TValue &value)
 Assumes that an object is not of the type supplied or a derived type. More...
 
template<typename Type , typename TValue >
static void is_not_instance_of (const TValue &value, const tunit::line_info &line_info)
 Assumes that an object is not of the type supplied or a derived type. More...
 
template<typename Type , typename TValue >
static void is_not_instance_of (const TValue &value, const std::string &message)
 Assumes that an object is not of the type supplied or a derived type. More...
 
template<typename Type , typename TValue >
static void is_not_instance_of (const TValue &value, const std::string &message, const tunit::line_info &line_info)
 Assumes that an object is not of the type supplied or a derived type. More...
 
template<typename TPointer >
static void is_not_null (const TPointer *pointer)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const TPointer *pointer, const tunit::line_info &line_info)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const TPointer *pointer, const std::string &message)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const TPointer *pointer, const std::string &message, const tunit::line_info &line_info)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::unique_ptr< TPointer > &pointer)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::unique_ptr< TPointer > &pointer, const tunit::line_info &line_info)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::unique_ptr< TPointer > &pointer, const std::string &message)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::unique_ptr< TPointer > &pointer, const std::string &message, const tunit::line_info &line_info)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::shared_ptr< TPointer > &pointer)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::shared_ptr< TPointer > &pointer, const tunit::line_info &line_info)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::shared_ptr< TPointer > &pointer, const std::string &message)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::shared_ptr< TPointer > &pointer, const std::string &message, const tunit::line_info &line_info)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::weak_ptr< TPointer > &pointer)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::weak_ptr< TPointer > &pointer, const tunit::line_info &line_info)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::weak_ptr< TPointer > &pointer, const std::string &message)
 Assumes that the pointer is not null. More...
 
template<typename TPointer >
static void is_not_null (const std::weak_ptr< TPointer > &pointer, const std::string &message, const tunit::line_info &line_info)
 Assumes that the pointer is not null. More...
 
static void is_not_null (std::nullptr_t pointer)
 Assumes that the pointer is not null. More...
 
static void is_not_null (std::nullptr_t pointer, const tunit::line_info &line_info)
 Assumes that the pointer is not null. More...
 
static void is_not_null (std::nullptr_t pointer, const std::string &message)
 Assumes that the pointer is not null. More...
 
static void is_not_null (std::nullptr_t pointer, const std::string &message, const tunit::line_info &line_info)
 Assumes that the pointer is not null. More...
 
template<typename TValue >
static void is_not_zero (const TValue &value)
 Assumes that ta condition is not zero. More...
 
template<typename TValue >
static void is_not_zero (const TValue &value, const tunit::line_info &line_info)
 Assumes that ta condition is not zero. More...
 
template<typename TValue >
static void is_not_zero (const TValue &value, const std::string &message)
 Assumes that ta condition is not zero. More...
 
template<typename TValue >
static void is_not_zero (const TValue &value, const std::string &message, const tunit::line_info &line_info)
 Assumes that ta condition is not zero. More...
 
template<typename TPointer >
static void is_null (const TPointer *pointer)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const TPointer *pointer, const tunit::line_info &line_info)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const TPointer *pointer, const std::string &message)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const TPointer *pointer, const std::string &message, const tunit::line_info &line_info)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::unique_ptr< TPointer > &pointer)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::unique_ptr< TPointer > &pointer, const tunit::line_info &line_info)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::unique_ptr< TPointer > &pointer, const std::string &message)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::unique_ptr< TPointer > &pointer, const std::string &message, const tunit::line_info &line_info)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::shared_ptr< TPointer > &pointer)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::shared_ptr< TPointer > &pointer, const tunit::line_info &line_info)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::shared_ptr< TPointer > &pointer, const std::string &message)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::shared_ptr< TPointer > &pointer, const std::string &message, const tunit::line_info &line_info)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::weak_ptr< TPointer > &pointer)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::weak_ptr< TPointer > &pointer, const tunit::line_info &line_info)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::weak_ptr< TPointer > &pointer, const std::string &message)
 Assumes that the pointer is null. More...
 
template<typename TPointer >
static void is_null (const std::weak_ptr< TPointer > &pointer, const std::string &message, const tunit::line_info &line_info)
 Assumes that the pointer is null. More...
 
static void is_null (std::nullptr_t pointer)
 Assumes that the pointer is null. More...
 
static void is_null (std::nullptr_t pointer, const tunit::line_info &line_info)
 Assumes that the pointer is null. More...
 
static void is_null (std::nullptr_t pointer, const std::string &message)
 Assumes that the pointer is null. More...
 
static void is_null (std::nullptr_t pointer, const std::string &message, const tunit::line_info &line_info)
 Assumes that the pointer is null. More...
 
template<typename TValue >
static void is_positive (const TValue &value)
 Assumes that ta condition is positive. More...
 
template<typename TValue >
static void is_positive (const TValue &value, const tunit::line_info &line_info)
 Assumes that ta condition is positive. More...
 
template<typename TValue >
static void is_positive (const TValue &value, const std::string &message)
 Assumes that ta condition is positive. More...
 
template<typename TValue >
static void is_positive (const TValue &value, const std::string &message, const tunit::line_info &line_info)
 Assumes that ta condition is positive. More...
 
static void is_true (bool condition)
 Assumes that ta condition is true. More...
 
static void is_true (bool condition, const tunit::line_info &line_info)
 Assumes that a condition is true. More...
 
static void is_true (bool condition, const std::string &message)
 Assumes that a condition is true. More...
 
static void is_true (bool condition, const std::string &message, const tunit::line_info &line_info)
 Assumes that a condition is true. More...
 
template<typename TValue >
static void is_zero (const TValue &value)
 Assumes that ta condition is zero. More...
 
template<typename TValue >
static void is_zero (const TValue &value, const tunit::line_info &line_info)
 Assumes that ta condition is zero. More...
 
template<typename TValue >
static void is_zero (const TValue &value, const std::string &message)
 Assumes that ta condition is zero. More...
 
template<typename TValue >
static void is_zero (const TValue &value, const std::string &message, const tunit::line_info &line_info)
 Assumes that ta condition is zero. More...
 
template<typename TException >
static void throws (const std::function< void()> &statement)
 Assumes that the statement throws a particular exception when called. More...
 
template<typename TException >
static void throws (const std::function< void()> &statement, const tunit::line_info &line_info)
 Assumes that the statement throws a particular exception when called. More...
 
template<typename TException >
static void throws (const std::function< void()> &statement, const std::string &message)
 Assumes that the statement throws a particular exception when called. More...
 
template<typename TException >
static void throws (const std::function< void()> &statement, const std::string &message, const tunit::line_info &line_info)
 Assumes that the statement throws a particular exception when called. More...
 
static void throws_any (const std::function< void()> &statement)
 Assumes that the staement does not throw an exception. More...
 
static void throws_any (const std::function< void()> &statement, const tunit::line_info &line_info)
 Assumes that the staement does not throw an exception. More...
 
static void throws_any (const std::function< void()> &statement, const std::string &message)
 Assumes that the staement does not throw an exception. More...
 
static void throws_any (const std::function< void()> &statement, const std::string &message, const tunit::line_info &line_info)
 Assumes that the staement does not throw an exception. More...
 

Static Private Member Functions

static void abort ()
 Abort current test. More...
 
static void abort (const tunit::line_info &line_info)
 Abort current test. More...
 
static void abort (const std::string &message)
 Abort current test. More...
 
static void abort (const std::string &message, const tunit::line_info &line_info)
 Abort current test. More...
 
static void error ()
 
static void error (const std::string &actual, const std::string &expected, const std::string &message, const tunit::line_info &line_info)
 
static void fail ()
 Throws an tunit::assertion_error exception. More...
 
static void fail (const tunit::line_info &line_info)
 Throws an tunit::assertion_error exception. More...
 
static void fail (const std::string &message)
 Throws an tunit::assertion_error exception. More...
 
static void fail (const std::string &message, const tunit::line_info &line_info)
 Throws an tunit::assertion_error exception. More...
 
static void fail (const std::string &actual, const std::string &expected, const std::string &message, const tunit::line_info &line_info)
 
static void ignore ()
 Ignore current test. More...
 
static void ignore (const tunit::line_info &line_info)
 Ignore current test. More...
 
static void ignore (const std::string &message)
 Ignore current test. More...
 
static void ignore (const std::string &message, const tunit::line_info &line_info)
 Ignore current test. More...
 
template<typename TCollection >
static std::string join_items (const TCollection &collection)
 
static std::string join_items (const std::string &str)
 
static void succeed ()
 Generates a success with a generic message. More...
 
static void succeed (const tunit::line_info &line_info)
 Generates a success with a generic message. More...
 
static void succeed (const std::string &message)
 Generates a success with a generic message. More...
 
static void succeed (const std::string &message, const tunit::line_info &line_info)
 Generates a success with a generic message. More...
 
template<typename TValue >
static std::string to_string (const TValue &value)
 
template<typename TValue >
static std::string to_string (const TValue *value)
 

Detailed Description

The assert class contains a collection of static methods that implement the most common assertions used in tUnit.

Examples
This example show how to used some methods :

Member Function Documentation

◆ are_equal() [1/16]

template<typename TExpected , typename TActual >
static void tunit::assume::are_equal ( const TExpected &  expected,
const TActual &  actual 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::are_equal(24, int(24)); // test ok.
tunit::assume::are_equal(23, int(24)); // test throws an abort_error exception.

◆ are_equal() [2/16]

template<typename TExpected , typename TActual >
static void tunit::assume::are_equal ( const TExpected &  expected,
const TActual &  actual,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::are_equal(24, int(24), line_info_); // test ok.
tunit::assume::are_equal(23, int(24), line_info_); // test throws an abort_error exception.

◆ are_equal() [3/16]

template<typename TExpected , typename TActual >
static void tunit::assume::are_equal ( const TExpected &  expected,
const TActual &  actual,
const std::string &  message 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::are_equal(24, int(24), "User message..."); // test ok.
tunit::assume::are_equal(23, int(24), "User message..."); // test throws an abort_error exception.

◆ are_equal() [4/16]

template<typename TExpected , typename TActual >
static void tunit::assume::are_equal ( const TExpected &  expected,
const TActual &  actual,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::are_equal(24, int(24), "User message...", line_info_); // test ok.
tunit::assume::are_equal(23, int(24), "User message...", line_info_); // test throws an abort_error exception.

◆ are_equal() [5/16]

static void tunit::assume::are_equal ( float  expected,
float  actual,
float  tolerance 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
float f = 0.00007999999999f;
tunit::assume::are_equal_(0.00008f, f, 0.0000000000001f); // test ok.
tunit::assume::are_equal_(0.00008f, f, 0.00000000000001f); // test throws an abort_error exception.

◆ are_equal() [6/16]

static void tunit::assume::are_equal ( float  expected,
float  actual,
float  tolerance,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
float f = 0.00007999999999f;
tunit::assume::are_equal_(0.00008f, f, 0.0000000000001f, line_info_); // test ok.
tunit::assume::are_equal_(0.00008f, f, 0.00000000000001f, line_info_); // test throws an abort_error exception.

◆ are_equal() [7/16]

static void tunit::assume::are_equal ( float  expected,
float &  actual,
float  tolerance,
const std::string &  message 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
float f = 0.00007999999999f;
tunit::assume::are_equal_(0.00008f, f, 0.0000000000001f, "User message..."); // test ok.
tunit::assume::are_equal_(0.00008f, f, 0.00000000000001f, "User message..."); // test throws an abort_error exception.

◆ are_equal() [8/16]

static void tunit::assume::are_equal ( float  expected,
float  actual,
float  tolerance,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
float f = 0.00007999999999f;
tunit::assume::are_equal_(0.00008f, f, 0.0000000000001f, "User message...", line_info_); // test ok.
tunit::assume::are_equal_(0.00008f, f, 0.00000000000001f, "User message...", line_info_); // test throws an abort_error exception.

◆ are_equal() [9/16]

static void tunit::assume::are_equal ( double  expected,
double  actual,
double  tolerance 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
double d = 0.00007999999999;
tunit::assume::are_equal_(0.00008, d, 0.0000000000001); // test ok.
tunit::assume::are_equal_(0.00008, d, 0.00000000000001); // test throws an abort_error exception.

◆ are_equal() [10/16]

static void tunit::assume::are_equal ( double  expected,
double  actual,
double  tolerance,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
double d = 0.00007999999999;
tunit::assume::are_equal_(0.00008, d, 0.0000000000001, line_info_); // test ok.
tunit::assume::are_equal_(0.00008, d, 0.00000000000001, line_info_); // test throws an abort_error exception.

◆ are_equal() [11/16]

static void tunit::assume::are_equal ( double  expected,
double  actual,
double  tolerance,
const std::string &  message 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
double d = 0.00007999999999;
tunit::assume::are_equal_(0.00008, d, 0.0000000000001, "User message..."); // test ok.
tunit::assume::are_equal_(0.00008, d, 0.00000000000001, "User message..."); // test throws an abort_error exception.

◆ are_equal() [12/16]

static void tunit::assume::are_equal ( double  expected,
double  actual,
double  tolerance,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
double d = 0.00007999999999;
tunit::assume::are_equal_(0.00008, d, 0.0000000000001, "User message...", line_info_); // test ok.
tunit::assume::are_equal_(0.00008, d, 0.00000000000001, "User message...", line_info_); // test throws an abort_error exception.

◆ are_equal() [13/16]

static void tunit::assume::are_equal ( long double  expected,
long double  actual,
long double  tolerance 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
long double ld = 0.00007999999999;
tunit::assume::are_equal_(0.00008l, ld, 0.0000000000001l); // test ok.
tunit::assume::are_equal_(0.00008l, ld, 0.00000000000001l); // test throws an abort_error exception.

◆ are_equal() [14/16]

static void tunit::assume::are_equal ( long double  expected,
long double  actual,
long double  tolerance,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
long double ld = 0.00007999999999;
tunit::assume::are_equal_(0.00008l, ld, 0.0000000000001l, line_info_); // test ok.
tunit::assume::are_equal_(0.00008l, ld, 0.00000000000001l, line_info_); // test throws an abort_error exception.

◆ are_equal() [15/16]

static void tunit::assume::are_equal ( long double  expected,
long double  actual,
long double  tolerance,
const std::string &  message 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
long double ld = 0.00007999999999;
tunit::assume::are_equal_(0.00008l, ld, 0.0000000000001l, "User message..."); // test ok.
tunit::assume::are_equal_(0.00008l, ld, 0.00000000000001l, "User message..."); // test throws an abort_error exception.

◆ are_equal() [16/16]

static void tunit::assume::are_equal ( long double  expected,
long double  actual,
long double  tolerance,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two type are equal.

Parameters
expectedthe expected value.
actualthe actual value.
toleleranceIndicates a tolerance within which they will be considered as equal.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
long double ld = 0.00007999999999;
tunit::assume::are_equal_(0.00008l, ld, 0.0000000000001l, "User message...", line_info_); // test ok.
tunit::assume::are_equal_(0.00008l, ld, 0.00000000000001l, "User message...", line_info_); // test throws an abort_error exception.

◆ are_not_equal() [1/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_not_equal ( const TExpected &  expected,
const TActual &  actual 
)
inlinestatic

Assumes that two type are not equal.

Parameters
expectedthe expected value.
actualthe actual value.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::are_not_equal(23, int(24)); // test ok.
tunit::assume::are_not_equal(24, int(24)); // test throws an abort_error exception.

◆ are_not_equal() [2/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_not_equal ( const TExpected &  expected,
const TActual &  actual,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two type are not equal.

Parameters
expectedthe expected value.
actualthe actual value.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::are_not_equal(23, int(24), line_info_); // test ok.
tunit::assume::are_not_equal(24, int(24), line_info_); // test throws an abort_error exception.

◆ are_not_equal() [3/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_not_equal ( const TExpected &  expected,
const TActual &  actual,
const std::string &  message 
)
inlinestatic

Assumes that two type are not equal.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::are_not_equal(23, int(24), "User message..."); // test ok.
tunit::assume::are_not_equal(24, int(24), "User message..."); // test throws an abort_error exception.

◆ are_not_equal() [4/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_not_equal ( const TExpected &  expected,
const TActual &  actual,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two type are not equal.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::are_not_equal(23, int(24), "User message...", line_info_); // test ok.
tunit::assume::are_not_equal(24, int(24), "User message...", line_info_); // test throws an abort_error exception.

◆ are_not_same() [1/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_not_same ( const TExpected &  expected,
const TActual &  actual 
)
inlinestatic

Assumes that two objects do refer to differents objects.

Parameters
expectedthe expected value.
actualthe actual value.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int a = 24;
int& b = a;
int c= 24;
tunit::assume::are_not_same(c, a); // test ok.
tunit::assume::are_not_same(b, a); // test throws an abort_error exception.

◆ are_not_same() [2/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_not_same ( const TExpected &  expected,
const TActual &  actual,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two objects do refer to differents objects.

Parameters
expectedthe expected value.
actualthe actual value.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int a = 24;
int& b = a;
int c= 24;
tunit::assume::are_not_same(b, a, line_info); // test throws an abort_error exception.

◆ are_not_same() [3/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_not_same ( const TExpected &  expected,
const TActual &  actual,
const std::string &  message 
)
inlinestatic

Assumes that two objects do refer to differents objects.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int a = 24;
int& b = a;
int c= 24;
tunit::assume::are_not_same(c, a, "User message..."); // test ok.
tunit::assume::are_not_same(b, a, "User message..."); // test throws an abort_error exception.

◆ are_not_same() [4/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_not_same ( const TExpected &  expected,
const TActual &  actual,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two objects do refer to differents objects.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int a = 24;
int& b = a;
int c= 24;
tunit::assume::are_not_same(c, a, "User message...", line_info_); // test ok.
tunit::assume::are_not_same(b, a, "User message...", line_info); // test throws an abort_error exception.

◆ are_same() [1/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_same ( const TExpected &  expected,
const TActual &  actual 
)
inlinestatic

Assumes that two objects do refer to differents objects.

Parameters
expectedthe expected value.
actualthe actual value.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int a = 24;
int& b = a;
int c= 24;
tunit::assume::are_same(b, a); // test ok.
tunit::assume::are_same(c, a); // test throws an abort_error exception.

◆ are_same() [2/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_same ( const TExpected &  expected,
const TActual &  actual,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two objects do refer to differents objects.

Parameters
expectedthe expected value.
actualthe actual value.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int a = 24;
int& b = a;
int c= 24;
tunit::assume::are_same(c, a, line_info_); // test throws an abort_error exception.

◆ are_same() [3/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_same ( const TExpected &  expected,
const TActual &  actual,
const std::string &  message 
)
inlinestatic

Assumes that two objects do refer to differents objects.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int a = 24;
int& b = a;
int c= 24;
tunit::assume::are_same(b, a, "User message..."); // test ok.
tunit::assume::are_same(c, a, "User message..."); // test throws an abort_error exception.

◆ are_same() [4/4]

template<typename TExpected , typename TActual >
static void tunit::assume::are_same ( const TExpected &  expected,
const TActual &  actual,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that two objects do refer to differents objects.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int a = 24;
int& b = a;
int c= 24;
tunit::assume::are_same(b, a, "User message...", line_info_); // test ok.
tunit::assume::are_same(c, a, "User message...", line_info_); // test throws an abort_error exception.

◆ contains() [1/4]

template<typename TItem , typename TCollection >
static void tunit::assume::contains ( const TItem &  item,
const TCollection &  collection 
)
inlinestatic

Assumes that collection contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
tunit::assume::contains(2, v1); // test ok.
tunit::assume::contains(4, v1); // test throws an abort_error exception.

◆ contains() [2/4]

template<typename TItem , typename TCollection >
static void tunit::assume::contains ( const TItem &  item,
const TCollection &  collection,
const tunit::line_info line_info 
)
inlinestatic

Assumes that collection contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
tunit::assume::contains(2, v1, line_info_); // test ok.
tunit::assume::contains(4, v1, line_info_); // test throws an abort_error exception.

◆ contains() [3/4]

template<typename TItem , typename TCollection >
static void tunit::assume::contains ( const TItem &  item,
const TCollection &  collection,
const std::string &  message 
)
inlinestatic

Assumes that collection contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
tunit::assume::contains(2, v1, "User message..."); // test ok.
tunit::assume::contains(4, v1, "User message..."); // test throws an abort_error exception.

◆ contains() [4/4]

template<typename TItem , typename TCollection >
static void tunit::assume::contains ( const TItem &  item,
const TCollection &  collection,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that collection contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
tunit::assume::contains(2, v1, "User message...", line_info_); // test ok.
tunit::assume::contains(4, v1, "User message...", line_info_); // test throws an abort_error exception.

◆ does_not_throw() [1/4]

static void tunit::assume::does_not_throw ( const std::function< void()> &  statement)
inlinestatic

Assumes that the staement does not throw an exception.

Parameters
statementThe statement that verify.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::does_not_throw([&] {v1.at(2);}); // test ok.
tunit::assume::does_not_throw([&] {v1.at(5);}); // test throws an abort_error exception.

◆ does_not_throw() [2/4]

static void tunit::assume::does_not_throw ( const std::function< void()> &  statement,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the staement does not throw an exception.

Parameters
statementThe statement that verify.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::does_not_throw([&] {v1.at(2);}, line_info_); // test ok.
tunit::assume::does_not_throw([&] {v1.at(5);}, line_info_); // test throws an abort_error exception.

◆ does_not_throw() [3/4]

static void tunit::assume::does_not_throw ( const std::function< void()> &  statement,
const std::string &  message 
)
inlinestatic

Assumes that the staement does not throw an exception.

Parameters
statementThe statement that verify.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::does_not_throw([&] {v1.at(2);}, "User message..."); // test ok.
tunit::assume::does_not_throw([&] {v1.at(5);}, "User message..."); // test throws an abort_error exception.

◆ does_not_throw() [4/4]

static void tunit::assume::does_not_throw ( const std::function< void()> &  statement,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the staement does not throw an exception.

Parameters
statementThe statement that verify.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::does_not_throw([&] {v1.at(2);}, "User message...", line_info_); // test ok.
tunit::assume::does_not_throw([&] {v1.at(5);}, "User message...", line_info_); // test throws an abort_error exception.

◆ is_empty() [1/4]

template<typename TValue >
static void tunit::assume::is_empty ( const TValue &  value)
inlinestatic

Assumes that collection contains an item.

Parameters
valueThe value to check is empty.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1;
std::vector<int> v2 = {0, 1, 2, 3};
tunit::assume::is_empty(v1); // test ok.
tunit::assume::is_empty(v2); // test throws an abort_error exception.

◆ is_empty() [2/4]

template<typename TValue >
static void tunit::assume::is_empty ( const TValue &  value,
const tunit::line_info line_info 
)
inlinestatic

Assumes that collection contains an item.

Parameters
valueThe value to check is empty.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1;
std::vector<int> v2 = {0, 1, 2, 3};
tunit::assume::is_empty(v2, line_info_); // test throws an abort_error exception.

◆ is_empty() [3/4]

template<typename TValue >
static void tunit::assume::is_empty ( const TValue &  value,
const std::string &  message 
)
inlinestatic

Assumes that collection contains an item.

Parameters
valueThe value to check is empty.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1;
std::vector<int> v2 = {0, 1, 2, 3};
tunit::assume::is_empty(v1, "User message..."); // test ok.
tunit::assume::is_empty(v2, "User message..."); // test throws an abort_error exception.

◆ is_empty() [4/4]

template<typename TValue >
static void tunit::assume::is_empty ( const TValue &  value,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that collection contains an item.

Parameters
valueThe value to check is empty.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1;
std::vector<int> v2 = {0, 1, 2, 3};
tunit::assume::is_empty(v1, "User message...", line_info_); // test ok.
tunit::assume::is_empty(v2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_greater_or_equal() [1/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_greater_or_equal ( const TValue1 &  val1,
const TValue2 &  val2 
)
inlinestatic

Assumes that the first value is greater than or equal to the second value.

Parameters
val1the first value.
val2the second value.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_greater_or_equal(24, 48); // test throws an abort_error exception.

◆ is_greater_or_equal() [2/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_greater_or_equal ( const TValue1 &  val1,
const TValue2 &  val2,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the first value is greater than or equal to the second value.

Parameters
val1the first value.
val2the second value.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_greater_or_equal(24, 48, line_info_); // test throws an abort_error exception.

◆ is_greater_or_equal() [3/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_greater_or_equal ( const TValue1 &  val1,
const TValue2 &  val2,
const std::string &  message 
)
inlinestatic

Assumes that the first value is greater than or equal to the second value.

Parameters
val1the first value.
val2the second value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_greater_or_equal(24, 12, "User message..."); // test ok.
tunit::assume::is_greater_or_equal(24, 24, "User message..."); // test ok.
tunit::assume::is_greater_or_equal(24, 48, "User message..."); // test throws an abort_error exception.

◆ is_greater_or_equal() [4/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_greater_or_equal ( const TValue1 &  val1,
const TValue2 &  val2,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the first value is greater than or equal to the second value.

Parameters
val1the first value.
val2the second value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_greater_or_equal(24, 12, "User message...", line_info_); // test ok.
tunit::assume::is_greater_or_equal(24, 24, "User message...", line_info_); // test ok.
tunit::assume::is_greater_or_equal(24, 48, "User message...", line_info_); // test throws an abort_error exception.

◆ is_instance_of() [1/4]

template<typename Type , typename TValue >
static void tunit::assume::is_instance_of ( const TValue &  value)
inlinestatic

Assumes that an object is of the type supplied or a derived type.

Parameters
valueThe object to verify
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::inassume_argument except("inassume argument");
tunit::assume::is_instance_of<std::logic_error>(except); // test ok.
tunit::assume::is_instance_of<std::bad_cast>(except); test fails

◆ is_instance_of() [2/4]

template<typename Type , typename TValue >
static void tunit::assume::is_instance_of ( const TValue &  value,
const tunit::line_info line_info 
)
inlinestatic

Assumes that an object is of the type supplied or a derived type.

Parameters
valueThe object to verify
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::inassume_argument except("inassume argument");
tunit::assume::is_instance_of<std::logic_error>(except, line_info_); // test ok.
tunit::assume::is_instance_of<std::bad_cast>(except, line_info_); test fails

◆ is_instance_of() [3/4]

template<typename Type , typename TValue >
static void tunit::assume::is_instance_of ( const TValue &  value,
const std::string &  message 
)
inlinestatic

Assumes that an object is of the type supplied or a derived type.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::inassume_argument except("inassume argument");
tunit::assume::is_instance_of<std::logic_error>(except, "User message..."); // test ok.
tunit::assume::is_instance_of<std::bad_cast>(except, "User message..."); test fails

◆ is_instance_of() [4/4]

template<typename Type , typename TValue >
static void tunit::assume::is_instance_of ( const TValue &  value,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that an object is of the type supplied or a derived type.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::inassume_argument except("inassume argument");
tunit::assume::is_instance_of<std::logic_error>(except, "User message...", line_info_); // test ok.
tunit::assume::is_instance_of<std::bad_cast>(except, "User message...", line_info_); test fails

◆ is_less() [1/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_less ( const TValue1 &  val1,
const TValue2 &  val2 
)
inlinestatic

Assumes that the first value is is_less than the second value.

Parameters
val1the first value.
val2the second value.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_less(24, 48); // test ok.
tunit::assume::is_less(24, 12); // test throws an abort_error exception.

◆ is_less() [2/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_less ( const TValue1 &  val1,
const TValue2 &  val2,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the first value is is_less than the second value.

Parameters
val1the first value.
val2the second value.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_less(24, 48, line_info_); // test ok.
tunit::assume::is_less(24, 12, line_info_); // test throws an abort_error exception.

◆ is_less() [3/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_less ( const TValue1 &  val1,
const TValue2 &  val2,
const std::string &  message 
)
inlinestatic

Assumes that the first value is is_less than the second value.

Parameters
val1the first value.
val2the second value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_less(24, 48, "User message..."); // test ok.
tunit::assume::is_less(24, 12, "User message..."); // test throws an abort_error exception.

◆ is_less() [4/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_less ( const TValue1 &  val1,
const TValue2 &  val2,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the first value is is_less than the second value.

Parameters
val1the first value.
val2the second value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_less(24, 48, "User message...", line_info_); // test ok.
tunit::assume::is_less(24, 12, "User message...", line_info_); // test throws an abort_error exception.

◆ is_less_or_equal() [1/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_less_or_equal ( const TValue1 &  val1,
const TValue2 &  val2 
)
inlinestatic

Assumes that the first value is is_less than or equal to the second value.

Parameters
val1the first value.
val2the second value.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_less_or_equal(24, 48); // test ok.
tunit::assume::is_less_or_equal(24, 24); // test ok.
tunit::assume::is_less_or_equal(24, 12); // test throws an abort_error exception.

◆ is_less_or_equal() [2/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_less_or_equal ( const TValue1 &  val1,
const TValue2 &  val2,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the first value is is_less than or equal to the second value.

Parameters
val1the first value.
val2the second value.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_less_or_equal(24, 12, line_info_); // test throws an abort_error exception.

◆ is_less_or_equal() [3/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_less_or_equal ( const TValue1 &  val1,
const TValue2 &  val2,
const std::string &  message 
)
inlinestatic

Assumes that the first value is is_less than or equal to the second value.

Parameters
val1the first value.
val2the second value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_less_or_equal(24, 48, "User message..."); // test ok.
tunit::assume::is_less_or_equal(24, 24, "User message..."); // test ok.
tunit::assume::is_less_or_equal(24, 12, "User message..."); // test throws an abort_error exception.

◆ is_less_or_equal() [4/4]

template<typename TValue1 , typename TValue2 >
static void tunit::assume::is_less_or_equal ( const TValue1 &  val1,
const TValue2 &  val2,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the first value is is_less than or equal to the second value.

Parameters
val1the first value.
val2the second value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_less_or_equal(24, 48, "User message...", line_info_); // test ok.
tunit::assume::is_less_or_equal(24, 24, "User message...", line_info_); // test ok.
tunit::assume::is_less_or_equal(24, 12, "User message...", line_info_); // test throws an abort_error exception.

◆ is_NaN() [1/12]

static void tunit::assume::is_NaN ( double  value)
inlinestatic

that a value is NaN.

Parameters
valueThe value to check is NaN.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
double v1 = std::numeric_limits<double>::quiet_NaN();
double v2 = 3.14159265358979323846;
tunit::assume::is_NaN(v1); // test ok.
tunit::assume::is_NaN(v2); // test throws an abort_error exception.

◆ is_NaN() [2/12]

static void tunit::assume::is_NaN ( double  value,
const tunit::line_info line_info 
)
inlinestatic

that a value is NaN.

Parameters
valueThe value to check is NaN.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
double v1 = std::numeric_limits<double>::quiet_NaN();
double v2 = 3.14159265358979323846;
tunit::assume::is_NaN(v2, line_info_); // test throws an abort_error exception.

◆ is_NaN() [3/12]

static void tunit::assume::is_NaN ( double  value,
const std::string &  message 
)
inlinestatic

Assumes that a value is NaN.

Parameters
valueThe value to check is NaN.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
double v1 = std::numeric_limits<double>::quiet_NaN();
double v2 = 3.14159265358979323846;
tunit::assume::is_NaN(v1, "User message..."); // test ok.
tunit::assume::is_NaN(v2, "User message..."); // test throws an abort_error exception.

◆ is_NaN() [4/12]

static void tunit::assume::is_NaN ( double  value,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that a value is NaN.

Parameters
valueThe value to check is NaN.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
double v1 = std::numeric_limits<double>::quiet_NaN();
double v2 = 3.14159265358979323846;
tunit::assume::is_NaN(v1, "User message...", line_info_); // test ok.
tunit::assume::is_NaN(v2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_NaN() [5/12]

static void tunit::assume::is_NaN ( long double  value)
inlinestatic

that a value is NaN.

Parameters
valueThe value to check is NaN.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
long double v1 = std::numeric_limits<double>::quiet_NaN();
long double v2 = 3.14159265358979323846l;
tunit::assume::is_NaN(v1); // test ok.
tunit::assume::is_NaN(v2); // test throws an abort_error exception.

◆ is_NaN() [6/12]

static void tunit::assume::is_NaN ( long double  value,
const tunit::line_info line_info 
)
inlinestatic

that a value is NaN.

Parameters
valueThe value to check is NaN.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
long double v1 = std::numeric_limits<long double>::quiet_NaN();
long double v2 = 3.14159265358979323846l;
tunit::assume::is_NaN(v2, line_info_); // test throws an abort_error exception.

◆ is_NaN() [7/12]

static void tunit::assume::is_NaN ( long double  value,
const std::string &  message 
)
inlinestatic

Assumes that a value is NaN.

Parameters
valueThe value to check is NaN.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
long double v1 = std::numeric_limits<long double>::quiet_NaN();
long double v2 = 3.14159265358979323846l;
tunit::assume::is_NaN(v1, "User message..."); // test ok.
tunit::assume::is_NaN(v2, "User message..."); // test throws an abort_error exception.

◆ is_NaN() [8/12]

static void tunit::assume::is_NaN ( long double  value,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that a value is NaN.

Parameters
valueThe value to check is NaN.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
long double v1 = std::numeric_limits<long double>::quiet_NaN();
long double v2 = 3.14159265358979323846l;
tunit::assume::is_NaN(v1, "User message...", line_info_); // test ok.
tunit::assume::is_NaN(v2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_NaN() [9/12]

static void tunit::assume::is_NaN ( float  value)
inlinestatic

that a value is NaN.

Parameters
valueThe value to check is NaN.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
float v1 = std::numeric_limits<float>::quiet_NaN();
float v2 = 3.14159265358979323846;
tunit::assume::is_NaN(v1); // test ok.
tunit::assume::is_NaN(v2); // test throws an abort_error exception.

◆ is_NaN() [10/12]

static void tunit::assume::is_NaN ( float  value,
const tunit::line_info line_info 
)
inlinestatic

that a value is NaN.

Parameters
valueThe value to check is NaN.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
float v1 = std::numeric_limits<float>::quiet_NaN();
float v2 = 3.14159265358979323846;
tunit::assume::is_NaN(v2, line_info_); // test throws an abort_error exception.

◆ is_NaN() [11/12]

static void tunit::assume::is_NaN ( float  value,
const std::string &  message 
)
inlinestatic

Assumes that a value is NaN.

Parameters
valueThe value to check is NaN.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
float v1 = std::numeric_limits<float>::quiet_NaN();
float v2 = 3.14159265358979323846;
tunit::assume::is_NaN(v1, "User message..."); // test ok.
tunit::assume::is_NaN(v2, "User message..."); // test throws an abort_error exception.

◆ is_NaN() [12/12]

static void tunit::assume::is_NaN ( float  value,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that a value is NaN.

Parameters
valueThe value to check is NaN.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
float v1 = std::numeric_limits<float>::quiet_NaN();
float v2 = 3.14159265358979323846;
tunit::assume::is_NaN(v1, "User message...", line_info_); // test ok.
tunit::assume::is_NaN(v2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_negative() [1/4]

template<typename TValue >
static void tunit::assume::is_negative ( const TValue &  value)
inlinestatic

Assumes that ta condition is negative.

Parameters
valueThe value to check is negative.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = -1;
int i2 = 1;
tunit::assume::is_negative(i2); // test throws an abort_error exception.

◆ is_negative() [2/4]

template<typename TValue >
static void tunit::assume::is_negative ( const TValue &  value,
const tunit::line_info line_info 
)
inlinestatic

Assumes that ta condition is negative.

Parameters
valueThe value to check is negative.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = -1;
int i2 = 1;
tunit::assume::is_negative(i2, line_info_); // test throws an abort_error exception.

◆ is_negative() [3/4]

template<typename TValue >
static void tunit::assume::is_negative ( const TValue &  value,
const std::string &  message 
)
inlinestatic

Assumes that ta condition is negative.

Parameters
valueThe value to check is negative.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = -1;
int i2 = 1;
tunit::assume::is_negative(i1, "User message..."); // test ok.
tunit::assume::is_negative(i2, "User message..."); // test throws an abort_error exception.

◆ is_negative() [4/4]

template<typename TValue >
static void tunit::assume::is_negative ( const TValue &  value,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that ta condition is negative.

Parameters
valueThe value to check is negative.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = -1;
int i2 = 1;
tunit::assume::is_negative(i1, "User message...", line_info_); // test ok.
tunit::assume::is_negative(i2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_not_empty() [1/4]

template<typename TValue >
static void tunit::assume::is_not_empty ( const TValue &  value)
inlinestatic

Assumes that collection oes not contain any item.

Parameters
valueThe value to check is empty.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
std::vector<int> v2;
tunit::assume::is_not_empty(v2); // test throws an abort_error exception.

◆ is_not_empty() [2/4]

template<typename TValue >
static void tunit::assume::is_not_empty ( const TValue &  value,
const tunit::line_info line_info 
)
inlinestatic

Assumes that collection does not contain any item.

Parameters
valueThe value to check is empty.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
std::vector<int> v2;
tunit::assume::is_not_empty(v2, line_info_); // test throws an abort_error exception.

◆ is_not_empty() [3/4]

template<typename TValue >
static void tunit::assume::is_not_empty ( const TValue &  value,
const std::string &  message 
)
inlinestatic

Assumes that collection does not contain any item.

Parameters
valueThe value to check is empty.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
std::vector<int> v2;
tunit::assume::is_not_empty(v1, "User message..."); // test ok.
tunit::assume::is_not_empty(v2, "User message..."); // test throws an abort_error exception.

◆ is_not_empty() [4/4]

template<typename TValue >
static void tunit::assume::is_not_empty ( const TValue &  value,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that collection does not contain any item.

Parameters
valueThe value to check is empty.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {0, 1, 2, 3};
std::vector<int> v2;
tunit::assume::is_not_empty(v1, "User message...", line_info_); // test ok.
tunit::assume::is_not_empty(v2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_not_instance_of() [1/4]

template<typename Type , typename TValue >
static void tunit::assume::is_not_instance_of ( const TValue &  value)
inlinestatic

Assumes that an object is not of the type supplied or a derived type.

Parameters
valueThe object to verify
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::inassume_argument except("inassume argument");
tunit::assume::is_not_instance_of<std::bad_cast>(except); // test ok.
tunit::assume::is_not_instance_of<std::logic_error>(except); test fails

◆ is_not_instance_of() [2/4]

template<typename Type , typename TValue >
static void tunit::assume::is_not_instance_of ( const TValue &  value,
const tunit::line_info line_info 
)
inlinestatic

Assumes that an object is not of the type supplied or a derived type.

Parameters
valueThe object to verify
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::inassume_argument except("inassume argument");
tunit::assume::is_not_instance_of<std::bad_cast>(except, line_info_); // test ok.
tunit::assume::is_not_instance_of<std::logic_error>(except, line_info_); test fails

◆ is_not_instance_of() [3/4]

template<typename Type , typename TValue >
static void tunit::assume::is_not_instance_of ( const TValue &  value,
const std::string &  message 
)
inlinestatic

Assumes that an object is not of the type supplied or a derived type.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::inassume_argument except("inassume argument");
tunit::assume::is_not_instance_of<std::bad_cast>(except, "User message..."); // test ok.
tunit::assume::is_not_instance_of<std::logic_error>(except, "User message..."); test fails

◆ is_not_instance_of() [4/4]

template<typename Type , typename TValue >
static void tunit::assume::is_not_instance_of ( const TValue &  value,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that an object is not of the type supplied or a derived type.

Parameters
valueThe object to verify
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::inassume_argument except("inassume argument");
tunit::assume::is_not_instance_of<std::bad_cast>(except, "User message...", line_info_); // test ok.
tunit::assume::is_not_instance_of<std::logic_error>(except, "User message...", line_info_); test fails

◆ is_not_null() [1/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const TPointer *  pointer)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string str = "Anything";
std::string* s1 = &str;
std::string* s2 = nullptr;
tunit::assume::is_not_null(s2); // test throws an abort_error exception.

◆ is_not_null() [2/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const TPointer *  pointer,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string str = "Anything";
std::string* s1 = &str;
std::string* s2 = nullptr;
tunit::assume::is_not_null(s2, line_info_); // test throws an abort_error exception.

◆ is_not_null() [3/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const TPointer *  pointer,
const std::string &  message 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string str = "Anything";
std::string* s1 = &str;
std::string* s2 = nullptr;
tunit::assume::is_not_null(s1, "User message..."); // test ok.
tunit::assume::is_not_null(s2, "User message..."); // test throws an abort_error exception.

◆ is_not_null() [4/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const TPointer *  pointer,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string str = "Anything";
std::string* s1 = &str;
std::string* s2 = nullptr;
tunit::assume::is_not_null(s1, "User message...", line_info_); // test ok.
tunit::assume::is_not_null(s2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_not_null() [5/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::unique_ptr< TPointer > &  pointer)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::unique_ptr<std::string> s1 = std::make_unique<std::string>("Anything");
std::unique_ptr<std::string> s2;
tunit::assume::is_not_null(s2); // test throws an abort_error exception.

◆ is_not_null() [6/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::unique_ptr< TPointer > &  pointer,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::unique_ptr<std::string> s1 = std::make_unique<std::string>("Anything");
std::unique_ptr<std::string> s2;
tunit::assume::is_not_null(s2, line_info_); // test throws an abort_error exception.

◆ is_not_null() [7/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::unique_ptr< TPointer > &  pointer,
const std::string &  message 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::unique_ptr<std::string> s1 = std::make_unique<std::string>("Anything");
std::unique_ptr<std::string> s2;
tunit::assume::is_not_null(s1, "User message..."); // test ok.
tunit::assume::is_not_null(s2, "User message..."); // test throws an abort_error exception.

◆ is_not_null() [8/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::unique_ptr< TPointer > &  pointer,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::unique_ptr<std::string> s1 = std::make_unique<std::string>("Anything");
std::unique_ptr<std::string> s2;
tunit::assume::is_not_null(s1, "User message...", line_info_); // test ok.
tunit::assume::is_not_null(s2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_not_null() [9/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::shared_ptr< TPointer > &  pointer)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s1 = std::make_shared<std::string>("Anything");
std::shared_ptr<std::string> s2;
tunit::assume::is_not_null(s2); // test throws an abort_error exception.

◆ is_not_null() [10/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::shared_ptr< TPointer > &  pointer,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s1 = std::make_shared<std::string>("Anything");
std::shared_ptr<std::string> s2;
tunit::assume::is_not_null(s2, line_info_); // test throws an abort_error exception.

◆ is_not_null() [11/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::shared_ptr< TPointer > &  pointer,
const std::string &  message 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s1 = std::make_shared<std::string>("Anything");
std::shared_ptr<std::string> s2;
tunit::assume::is_not_null(s1, "User message..."); // test ok.
tunit::assume::is_not_null(s2, "User message..."); // test throws an abort_error exception.

◆ is_not_null() [12/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::shared_ptr< TPointer > &  pointer,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s1 = std::make_shared<std::string>("Anything");
std::shared_ptr<std::string> s2;
tunit::assume::is_not_null(s1, "User message...", line_info_); // test ok.
tunit::assume::is_not_null(s2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_not_null() [13/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::weak_ptr< TPointer > &  pointer)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
Remarks
Always true, a weaptr can't be equal to nullptr by contruction or assignation.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s = std::make_shared<std::string>("Anything");
std::weak_ptr<std::string> s1 = s;
std::weak_ptr<std::string> s2;

◆ is_not_null() [14/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::weak_ptr< TPointer > &  pointer,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
line_infoContains information about current file and current line.
Remarks
Always true, a weaptr can't be equal to nullptr by contruction or assignation.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s = std::make_shared<std::string>("Anything");
std::weak_ptr<std::string> s1 = s;
std::weak_ptr<std::string> s2;

◆ is_not_null() [15/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::weak_ptr< TPointer > &  pointer,
const std::string &  message 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Always true, a weaptr can't be equal to nullptr by contruction or assignation.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s = std::make_shared<std::string>("Anything");
std::weak_ptr<std::string> s1 = s;
std::weak_ptr<std::string> s2;
tunit::assume::is_not_null(s1, "User message..."); // test ok.
tunit::assume::is_not_null(s2, "User message..."); // test ok.

◆ is_not_null() [16/20]

template<typename TPointer >
static void tunit::assume::is_not_null ( const std::weak_ptr< TPointer > &  pointer,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Remarks
Always true, a weaptr can't be equal to nullptr by contruction or assignation.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s = std::make_shared<std::string>("Anything");
std::weak_ptr<std::string> s1 = s;
std::weak_ptr<std::string> s2;
tunit::assume::is_not_null(s1, "User message...", line_info_); // test ok.
tunit::assume::is_not_null(s2, "User message...", line_info_); // test ok.

◆ is_not_null() [17/20]

static void tunit::assume::is_not_null ( std::nullptr_t  pointer)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
Remarks
Always false, a nullptr_t is always equal to nullptr.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_not_null(nullptr); // test throws an abort_error exception.

◆ is_not_null() [18/20]

static void tunit::assume::is_not_null ( std::nullptr_t  pointer,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
line_infoContains information about current file and current line.
Remarks
Always false, a nullptr_t is always equal to nullptr.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_not_null(nullptr, line_info_); // test throws an abort_error exception.

◆ is_not_null() [19/20]

static void tunit::assume::is_not_null ( std::nullptr_t  pointer,
const std::string &  message 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Always false, a nullptr_t is always equal to nullptr.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_not_null(nullptr, "User message..."); // test throws an abort_error exception.

◆ is_not_null() [20/20]

static void tunit::assume::is_not_null ( std::nullptr_t  pointer,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is not null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Remarks
Always false, a nullptr_t is always equal to nullptr.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_not_null(nullptr, "User message...", line_info_); // test throws an abort_error exception.

◆ is_not_zero() [1/4]

template<typename TValue >
static void tunit::assume::is_not_zero ( const TValue &  value)
inlinestatic

Assumes that ta condition is not zero.

Parameters
valueThe value to check is not zero.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 42;
int i2 = 0;
tunit::assume::is_not_zero(i2); // test throws an abort_error exception.

◆ is_not_zero() [2/4]

template<typename TValue >
static void tunit::assume::is_not_zero ( const TValue &  value,
const tunit::line_info line_info 
)
inlinestatic

Assumes that ta condition is not zero.

Parameters
valueThe value to check is not zero.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 42;
int i2 = 0;
tunit::assume::is_not_zero(i2, line_info_); // test throws an abort_error exception.

◆ is_not_zero() [3/4]

template<typename TValue >
static void tunit::assume::is_not_zero ( const TValue &  value,
const std::string &  message 
)
inlinestatic

Assumes that ta condition is not zero.

Parameters
valueThe value to check is not zero.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 42;
int i2 = 0;
tunit::assume::is_not_zero(i1, "User message..."); // test ok.
tunit::assume::is_not_zero(i2, "User message..."); // test throws an abort_error exception.

◆ is_not_zero() [4/4]

template<typename TValue >
static void tunit::assume::is_not_zero ( const TValue &  value,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that ta condition is not zero.

Parameters
valueThe value to check is not zero.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 42;
int i2 = 0;
tunit::assume::is_not_zero(i1, "User message...", line_info_); // test ok.
tunit::assume::is_not_zero(i2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_null() [1/20]

template<typename TPointer >
static void tunit::assume::is_null ( const TPointer *  pointer)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string str = "Anything";
std::string* s1 = nullptr;
std::string* s2 = &str;
tunit::assume::is_null(s1); // test ok.
tunit::assume::is_null(s2); // test throws an abort_error exception.

◆ is_null() [2/20]

template<typename TPointer >
static void tunit::assume::is_null ( const TPointer *  pointer,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string str = "Anything";
std::string* s1 = nullptr;
std::string* s2 = &str;
tunit::assume::is_null(s2, line_info_); // test throws an abort_error exception.

◆ is_null() [3/20]

template<typename TPointer >
static void tunit::assume::is_null ( const TPointer *  pointer,
const std::string &  message 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string str = "Anything";
std::string* s1 = nullptr;
std::string* s2 = &str;
tunit::assume::is_null(s1, "User message..."); // test ok.
tunit::assume::is_null(s2, "User message..."); // test throws an abort_error exception.

◆ is_null() [4/20]

template<typename TPointer >
static void tunit::assume::is_null ( const TPointer *  pointer,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string str = "Anything";
std::string* s1 = nullptr;
std::string* s2 = &str;
tunit::assume::is_null(s1, "User message...", line_info_); // test ok.
tunit::assume::is_null(s2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_null() [5/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::unique_ptr< TPointer > &  pointer)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::unique_ptr<std::string> s1;
std::unique_ptr<std::string> s2 = std::make_unique<std::string>("Anything");
tunit::assume::is_null(s1); // test ok.
tunit::assume::is_null(s2); // test throws an abort_error exception.

◆ is_null() [6/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::unique_ptr< TPointer > &  pointer,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::unique_ptr<std::string> s1;
std::unique_ptr<std::string> s2 = std::make_unique<std::string>("Anything");
tunit::assume::is_null(s2, line_info_); // test throws an abort_error exception.

◆ is_null() [7/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::unique_ptr< TPointer > &  pointer,
const std::string &  message 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::unique_ptr<std::string> s1;
std::unique_ptr<std::string> s2 = std::make_unique<std::string>("Anything");
tunit::assume::is_null(s1, "User message..."); // test ok.
tunit::assume::is_null(s2, "User message..."); // test throws an abort_error exception.

◆ is_null() [8/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::unique_ptr< TPointer > &  pointer,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::unique_ptr<std::string> s1;
std::unique_ptr<std::string> s2 = std::make_unique<std::string>("Anything");
tunit::assume::is_null(s1, "User message...", line_info_); // test ok.
tunit::assume::is_null(s2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_null() [9/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::shared_ptr< TPointer > &  pointer)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s1;
std::shared_ptr<std::string> s2 = std::make_shared<std::string>("Anything");
tunit::assume::is_null(s1); // test ok.
tunit::assume::is_null(s2); // test throws an abort_error exception.

◆ is_null() [10/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::shared_ptr< TPointer > &  pointer,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s1;
std::shared_ptr<std::string> s2 = std::make_shared<std::string>("Anything");
tunit::assume::is_null(s2, line_info_); // test throws an abort_error exception.

◆ is_null() [11/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::shared_ptr< TPointer > &  pointer,
const std::string &  message 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s1;
std::shared_ptr<std::string> s2 = std::make_shared<std::string>("Anything");
tunit::assume::is_null(s1, "User message..."); // test ok.
tunit::assume::is_null(s2, "User message..."); // test throws an abort_error exception.

◆ is_null() [12/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::shared_ptr< TPointer > &  pointer,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s1;
std::shared_ptr<std::string> s2 = std::make_shared<std::string>("Anything");
tunit::assume::is_null(s1, "User message...", line_info_); // test ok.
tunit::assume::is_null(s2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_null() [13/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::weak_ptr< TPointer > &  pointer)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
Remarks
Always false, a weaptr can't be equal to nullptr by contruction or assignation.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s = std::make_shared<std::string>("Anything");
std::weak_ptr<std::string> s1;
std::weak_ptr<std::string> s2 = s;
tunit::assume::is_null(s1); // test throws an abort_error exception.
tunit::assume::is_null(s2); // test throws an abort_error exception.

◆ is_null() [14/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::weak_ptr< TPointer > &  pointer,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
line_infoContains information about current file and current line.
Remarks
Always false, a weaptr can't be equal to nullptr by contruction or assignation.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s = std::make_shared<std::string>("Anything");
std::weak_ptr<std::string> s1;
std::weak_ptr<std::string> s2 = s;
tunit::assume::is_null(s1, line_info_); // test throws an abort_error exception.
tunit::assume::is_null(s2, line_info_); // test throws an abort_error exception.

◆ is_null() [15/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::weak_ptr< TPointer > &  pointer,
const std::string &  message 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Always false, a weaptr can't be equal to nullptr by contruction or assignation.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s = std::make_shared<std::string>("Anything");
std::weak_ptr<std::string> s1;
std::weak_ptr<std::string> s2 = s;
tunit::assume::is_null(s1, "User message..."); // test throws an abort_error exception.
tunit::assume::is_null(s2, "User message..."); // test throws an abort_error exception.

◆ is_null() [16/20]

template<typename TPointer >
static void tunit::assume::is_null ( const std::weak_ptr< TPointer > &  pointer,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Remarks
Always false, a weaptr can't be equal to nullptr by contruction or assignation.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::shared_ptr<std::string> s = std::make_shared<std::string>("Anything");
std::weak_ptr<std::string> s1;
std::weak_ptr<std::string> s2 = s;
tunit::assume::is_null(s1, "User message...", line_info_); // test throws an abort_error exception.
tunit::assume::is_null(s2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_null() [17/20]

static void tunit::assume::is_null ( std::nullptr_t  pointer)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
Remarks
Always false, a nullptr_t is always equal to nullptr.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_null(nullptr); // test ok.

◆ is_null() [18/20]

static void tunit::assume::is_null ( std::nullptr_t  pointer,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
line_infoContains information about current file and current line.
Remarks
Always false, a nullptr_t is always equal to nullptr.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_null(nullptr, line_info_); // test ok.

◆ is_null() [19/20]

static void tunit::assume::is_null ( std::nullptr_t  pointer,
const std::string &  message 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Remarks
Always false, a nullptr_t is always equal to nullptr.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_null(nullptr, "User message..."); // test ok.

◆ is_null() [20/20]

static void tunit::assume::is_null ( std::nullptr_t  pointer,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the pointer is null.

Parameters
pointerThe pointer to check is null.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Remarks
Always false, a nullptr_t is always equal to nullptr.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
tunit::assume::is_null(nullptr, "User message...", line_info_); // test ok.

◆ is_positive() [1/4]

template<typename TValue >
static void tunit::assume::is_positive ( const TValue &  value)
inlinestatic

Assumes that ta condition is positive.

Parameters
valueThe value to check is positive.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 1;
int i2 = -1;
tunit::assume::is_positive(i2); // test throws an abort_error exception.

◆ is_positive() [2/4]

template<typename TValue >
static void tunit::assume::is_positive ( const TValue &  value,
const tunit::line_info line_info 
)
inlinestatic

Assumes that ta condition is positive.

Parameters
valueThe value to check is positive.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 1;
int i2 = -1;
tunit::assume::is_positive(i2, line_info_); // test throws an abort_error exception.

◆ is_positive() [3/4]

template<typename TValue >
static void tunit::assume::is_positive ( const TValue &  value,
const std::string &  message 
)
inlinestatic

Assumes that ta condition is positive.

Parameters
valueThe value to check is positive.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 1;
int i2 = -1;
tunit::assume::is_positive(i1, "User message..."); // test ok.
tunit::assume::is_positive(i2, "User message..."); // test throws an abort_error exception.

◆ is_positive() [4/4]

template<typename TValue >
static void tunit::assume::is_positive ( const TValue &  value,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that ta condition is positive.

Parameters
valueThe value to check is positive.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 1;
int i2 = -1;
tunit::assume::is_positive(i1, "User message...", line_info_); // test ok.
tunit::assume::is_positive(i2, "User message...", line_info_); // test throws an abort_error exception.

◆ is_true() [1/4]

static void tunit::assume::is_true ( bool  condition)
inlinestatic

Assumes that ta condition is true.

Parameters
conditionThe condition to check is true.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string s1;
std::string s2 = "Anything";
tunit::assume::is_false(std::empty(s1)); // test ok.
tunit::assume::is_false(std::empty(s2)); // test throws an abort_error exception.

◆ is_true() [2/4]

static void tunit::assume::is_true ( bool  condition,
const tunit::line_info line_info 
)
inlinestatic

Assumes that a condition is true.

Parameters
conditionThe condition to check is true.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string s1;
std::string s2 = "Anything";
tunit::assume::is_false(std::empty(s1), line_info_); // test ok.
tunit::assume::is_false(std::empty(s2), line_info_); // test throws an abort_error exception.

◆ is_true() [3/4]

static void tunit::assume::is_true ( bool  condition,
const std::string &  message 
)
inlinestatic

Assumes that a condition is true.

Parameters
conditionThe condition to check is true.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string s1;
std::string s2 = "Anything";
tunit::assume::is_false(std::empty(s1), "User message..."); // test ok.
tunit::assume::is_false(std::empty(s2), "User message..."); // test throws an abort_error exception.

◆ is_true() [4/4]

static void tunit::assume::is_true ( bool  condition,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that a condition is true.

Parameters
conditionThe condition to check is true.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::string s1;
std::string s2 = "Anything";
tunit::assume::is_false(std::empty(s1), "User message...", line_info_); // test ok.
tunit::assume::is_false(std::empty(s2), "User message...", line_info_); // test throws an abort_error exception.

◆ is_zero() [1/4]

template<typename TValue >
static void tunit::assume::is_zero ( const TValue &  value)
inlinestatic

Assumes that ta condition is zero.

Parameters
valueThe value to check is zero.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 0;
int i2 = 42;
tunit::assume::is_zero(i1); // test ok.
tunit::assume::is_zero(i2); // test throws an abort_error exception.

◆ is_zero() [2/4]

template<typename TValue >
static void tunit::assume::is_zero ( const TValue &  value,
const tunit::line_info line_info 
)
inlinestatic

Assumes that ta condition is zero.

Parameters
valueThe value to check is zero.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 0;
int i2 = 42;
tunit::assume::is_zero(i2, line_info_); // test throws an abort_error exception.

◆ is_zero() [3/4]

template<typename TValue >
static void tunit::assume::is_zero ( const TValue &  value,
const std::string &  message 
)
inlinestatic

Assumes that ta condition is zero.

Parameters
valueThe value to check is zero.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 0;
int i2 = 42;
tunit::assume::is_zero(i1, "User message..."); // test ok.
tunit::assume::is_zero(i2, "User message..."); // test throws an abort_error exception.

◆ is_zero() [4/4]

template<typename TValue >
static void tunit::assume::is_zero ( const TValue &  value,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that ta condition is zero.

Parameters
valueThe value to check is zero.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
int i1 = 0;
int i2 = 42;
tunit::assume::is_zero(i1, "User message...", line_info_); // test ok.
tunit::assume::is_zero(i2, "User message...", line_info_); // test throws an abort_error exception.

◆ throws() [1/4]

template<typename TException >
static void tunit::assume::throws ( const std::function< void()> &  statement)
inlinestatic

Assumes that the statement throws a particular exception when called.

Parameters
TExceptionThe exception type that must be throw.
statementThe statement that verify.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::throws<std::out_of_range>([&] {v1.at(5);}); // test ok.
tunit::assume::throws<std::out_of_range>([&] {v1.at(2);}); // test throws an abort_error exception.

◆ throws() [2/4]

template<typename TException >
static void tunit::assume::throws ( const std::function< void()> &  statement,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the statement throws a particular exception when called.

Parameters
TExceptionThe exception type that must be throw.
statementThe statement that verify.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::throws<std::out_of_range>([&] {v1.at(5);}, line_info_); // test ok.
tunit::assume::throws<std::out_of_range>([&] {v1.at(2);}, line_info_); // test throws an abort_error exception.

◆ throws() [3/4]

template<typename TException >
static void tunit::assume::throws ( const std::function< void()> &  statement,
const std::string &  message 
)
inlinestatic

Assumes that the statement throws a particular exception when called.

Parameters
TExceptionThe exception type that must be throw.
statementThe statement that verify.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::throws<std::out_of_range>([&] {v1.at(5);}, "User message..."); // test ok.
tunit::assume::throws<std::out_of_range>([&] {v1.at(2);}, "User message..."); // test throws an abort_error exception.

◆ throws() [4/4]

template<typename TException >
static void tunit::assume::throws ( const std::function< void()> &  statement,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the statement throws a particular exception when called.

Parameters
TExceptionThe exception type that must be throw.
statementThe statement that verify.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::throws<std::out_of_range>([&] {v1.at(5);}, "User message...", line_info_); // test ok.
tunit::assume::throws<std::out_of_range>([&] {v1.at(2);}, "User message...", line_info_); // test throws an abort_error exception.

◆ throws_any() [1/4]

static void tunit::assume::throws_any ( const std::function< void()> &  statement)
inlinestatic

Assumes that the staement does not throw an exception.

Parameters
statementThe statement that verify.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::throws_any([&] {v1.at(5);}); // test ok.
tunit::assume::throws_any([&] {v1.at(2);}); // test throws an abort_error exception.

◆ throws_any() [2/4]

static void tunit::assume::throws_any ( const std::function< void()> &  statement,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the staement does not throw an exception.

Parameters
statementThe statement that verify.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::throws_any([&] {v1.at(5);}, line_info_); // test ok.
tunit::assume::throws_any([&] {v1.at(2);}, line_info_); // test throws an abort_error exception.

◆ throws_any() [3/4]

static void tunit::assume::throws_any ( const std::function< void()> &  statement,
const std::string &  message 
)
inlinestatic

Assumes that the staement does not throw an exception.

Parameters
statementThe statement that verify.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::throws_any([&] {v1.at(5);}, "User message..."); // test ok.
tunit::assume::throws_any([&] {v1.at(2);}, "User message..."); // test throws an abort_error exception.

◆ throws_any() [4/4]

static void tunit::assume::throws_any ( const std::function< void()> &  statement,
const std::string &  message,
const tunit::line_info line_info 
)
inlinestatic

Assumes that the staement does not throw an exception.

Parameters
statementThe statement that verify.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
line_infoContains information about current file and current line.
Exceptions
tunit::abort_errorIf bad assertion.
Examples
std::vector<int> v1 = {1, 2, 3, 4};
tunit::assume::throws_any([&] {v1.at(5);}, "User message...", line_info_); // test ok.
tunit::assume::throws_any([&] {v1.at(2);}, "User message...", line_info_); // test throws an abort_error exception.

The documentation for this class was generated from the following file: