libept
Classes | Functions
ept::tests Namespace Reference

Classes

struct  Actual
 
struct  ActualCString
 
struct  ActualDouble
 
struct  ActualFunction
 
struct  ActualStdString
 
struct  Fixture
 Base class for test fixtures. More...
 
struct  FixtureTestCase
 Test case that includes a fixture. More...
 
struct  LocationInfo
 Add information to the test backtrace for the tests run in the current scope. More...
 
struct  SimpleTestController
 Simple default implementation of TestController. More...
 
struct  TestCase
 Test case collecting several test methods, and self-registering with the singleton instance of TestRegistry. More...
 
struct  TestCaseResult
 Result of running a whole test case. More...
 
struct  TestController
 Abstract interface for the objects that supervise test execution. More...
 
struct  TestFailed
 Exception raised when a test assertion fails, normally by Location::fail_test. More...
 
struct  TestMethod
 Test method information. More...
 
struct  TestMethodResult
 Result of running a test method. More...
 
struct  TestRegistry
 Test registry. More...
 
struct  TestStack
 
struct  TestStackFrame
 Information about one stack frame in the test execution stack. More...
 

Functions

void assert_startswith (const std::string &actual, const std::string &expected)
 Ensure that the string actual starts with expected. More...
 
void assert_endswith (const std::string &actual, const std::string &expected)
 Ensure that the string actual ends with expected. More...
 
void assert_contains (const std::string &actual, const std::string &expected)
 Ensure that the string actual contains expected. More...
 
void assert_not_contains (const std::string &actual, const std::string &expected)
 Ensure that the string actual does not contain expected. More...
 
void assert_re_matches (const std::string &actual, const std::string &expected)
 Ensure that the string actual matches the extended regular expression expected. More...
 
void assert_not_re_matches (const std::string &actual, const std::string &expected)
 Ensure that the string actual does not match the extended regular expression expected. More...
 
void assert_true (std::nullptr_t actual)
 
void assert_false (std::nullptr_t actual)
 
template<typename A >
void assert_true (const A &actual)
 Test function that ensures that the actual value is true. More...
 
template<typename A >
void assert_false (const A &actual)
 Test function that ensures that the actual value is false. More...
 
template<typename A , typename E >
void assert_equal (const A &actual, const E &expected)
 Test function that ensures that the actual value is the same as a reference one. More...
 
template<typename A , typename E >
void assert_not_equal (const A &actual, const E &expected)
 Test function that ensures that the actual value is different than a reference one. More...
 
template<typename A , typename E >
void assert_less (const A &actual, const E &expected)
 Ensure that the actual value is less than the reference value. More...
 
template<typename A , typename E >
void assert_less_equal (const A &actual, const E &expected)
 Ensure that the actual value is less or equal than the reference value. More...
 
template<typename A , typename E >
void assert_greater (const A &actual, const E &expected)
 Ensure that the actual value is greater than the reference value. More...
 
template<typename A , typename E >
void assert_greater_equal (const A &actual, const E &expected)
 Ensure that the actual value is greather or equal than the reference value. More...
 
template<typename A >
Actual< A > actual (const A &actual)
 
ActualCString actual (const char *actual)
 
ActualCString actual (char *actual)
 
ActualStdString actual (const std::string &actual)
 
ActualDouble actual (double actual)
 
ActualFunction actual_function (std::function< void()> actual)
 

Function Documentation

◆ actual() [1/5]

template<typename A >
Actual<A> ept::tests::actual ( const A &  actual)
inline

◆ actual() [2/5]

ActualCString ept::tests::actual ( const char *  actual)
inline

◆ actual() [3/5]

ActualCString ept::tests::actual ( char *  actual)
inline

◆ actual() [4/5]

ActualStdString ept::tests::actual ( const std::string &  actual)
inline

◆ actual() [5/5]

ActualDouble ept::tests::actual ( double  actual)
inline

◆ actual_function()

ActualFunction ept::tests::actual_function ( std::function< void()>  actual)
inline

◆ assert_contains()

void ept::tests::assert_contains ( const std::string &  actual,
const std::string &  expected 
)

◆ assert_endswith()

void ept::tests::assert_endswith ( const std::string &  actual,
const std::string &  expected 
)

◆ assert_equal()

template<typename A , typename E >
void ept::tests::assert_equal ( const A &  actual,
const E &  expected 
)

Test function that ensures that the actual value is the same as a reference one.

Referenced by ept::tests::Actual< std::function< void()> >::operator==().

◆ assert_false() [1/2]

template<typename A >
void ept::tests::assert_false ( const A &  actual)

Test function that ensures that the actual value is false.

References assert_false().

◆ assert_false() [2/2]

void ept::tests::assert_false ( std::nullptr_t  actual)

◆ assert_greater()

template<typename A , typename E >
void ept::tests::assert_greater ( const A &  actual,
const E &  expected 
)

Ensure that the actual value is greater than the reference value.

Referenced by ept::tests::Actual< std::function< void()> >::operator>().

◆ assert_greater_equal()

template<typename A , typename E >
void ept::tests::assert_greater_equal ( const A &  actual,
const E &  expected 
)

Ensure that the actual value is greather or equal than the reference value.

References assert_contains(), assert_endswith(), assert_not_contains(), assert_not_re_matches(), assert_re_matches(), and assert_startswith().

Referenced by ept::tests::Actual< std::function< void()> >::operator>=().

◆ assert_less()

template<typename A , typename E >
void ept::tests::assert_less ( const A &  actual,
const E &  expected 
)

Ensure that the actual value is less than the reference value.

Referenced by ept::tests::Actual< std::function< void()> >::operator<().

◆ assert_less_equal()

template<typename A , typename E >
void ept::tests::assert_less_equal ( const A &  actual,
const E &  expected 
)

Ensure that the actual value is less or equal than the reference value.

Referenced by ept::tests::Actual< std::function< void()> >::operator<=().

◆ assert_not_contains()

void ept::tests::assert_not_contains ( const std::string &  actual,
const std::string &  expected 
)

Ensure that the string actual does not contain expected.

References ept::tests::TestFailed::TestFailed().

Referenced by assert_greater_equal(), ept::tests::ActualCString::not_contains(), and ept::tests::ActualStdString::not_contains().

◆ assert_not_equal()

template<typename A , typename E >
void ept::tests::assert_not_equal ( const A &  actual,
const E &  expected 
)

Test function that ensures that the actual value is different than a reference one.

Referenced by ept::tests::Actual< std::function< void()> >::operator!=().

◆ assert_not_re_matches()

void ept::tests::assert_not_re_matches ( const std::string &  actual,
const std::string &  expected 
)

Ensure that the string actual does not match the extended regular expression expected.

The syntax is that of extended regular expression (see man regex(7) ).

References ept::tests::TestFailed::TestFailed().

Referenced by assert_greater_equal(), ept::tests::ActualCString::not_matches(), and ept::tests::ActualStdString::not_matches().

◆ assert_re_matches()

void ept::tests::assert_re_matches ( const std::string &  actual,
const std::string &  expected 
)

Ensure that the string actual matches the extended regular expression expected.

The syntax is that of extended regular expression (see man regex(7) ).

References ept::tests::TestFailed::TestFailed().

Referenced by assert_greater_equal(), ept::tests::ActualCString::matches(), and ept::tests::ActualStdString::matches().

◆ assert_startswith()

void ept::tests::assert_startswith ( const std::string &  actual,
const std::string &  expected 
)

◆ assert_true() [1/2]

template<typename A >
void ept::tests::assert_true ( const A &  actual)

Test function that ensures that the actual value is true.

References actual(), and assert_true().

◆ assert_true() [2/2]

void ept::tests::assert_true ( std::nullptr_t  actual)