Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
doctest::detail Namespace Reference

Namespaces

namespace  assertAction
 
namespace  binaryAssertComparison
 
namespace  types
 

Data Structures

class  ContextScope
 
struct  ContextScopeBase
 
struct  deferred_false
 
class  ExceptionTranslator
 OCLINT destructor of virtual class. More...
 
struct  Expression_lhs
 
struct  ExpressionDecomposer
 
struct  filldata
 
struct  filldata< const char[N]>
 
struct  filldata< const void * >
 
struct  filldata< T * >
 
struct  filldata< T[N]>
 
struct  has_insertion_operator
 
struct  has_insertion_operator< T, decltype(operator<<(declval< std::ostream & >(), declval< const T & >()), void())>
 
struct  IExceptionTranslator
 
struct  MessageBuilder
 
struct  RelationalComparator
 
struct  Result
 
struct  ResultBuilder
 
struct  should_stringify_as_underlying_type
 
struct  StringMakerBase
 
struct  StringMakerBase< true >
 
struct  Subcase
 
struct  TestCase
 
struct  TestFailureException
 
struct  TestSuite
 

Typedefs

using funcType = void (*)()
 
using assert_handler = void (*)(const AssertData&)
 
using reporterCreatorFunc = IReporter* (*)(const ContextOptions&)
 

Functions

static DOCTEST_CONSTEXPR int consume (const int *, int) noexcept
 
template<typename T >
T && declval ()
 
template<class T >
DOCTEST_CONSTEXPR_FUNC T && forward (typename types::remove_reference< T >::type &t) DOCTEST_NOEXCEPT
 
template<class T >
DOCTEST_CONSTEXPR_FUNC T && forward (typename types::remove_reference< T >::type &&t) DOCTEST_NOEXCEPT
 
DOCTEST_INTERFACE std::ostreamtlssPush ()
 
DOCTEST_INTERFACE String tlssPop ()
 
template<typename T >
void filloss (std::ostream *stream, const T &in)
 
template<typename T , size_t N>
void filloss (std::ostream *stream, const T(&in)[N])
 
template<typename T >
String toStream (const T &in)
 
DOCTEST_INTERFACE bool checkIfShouldThrow (assertType::Enum at)
 
DOCTEST_INTERFACE void throwException ()
 
template<typename L , typename R >
String stringifyBinaryExpr (const DOCTEST_REF_WRAP(L) lhs, const char *op, const DOCTEST_REF_WRAP(R) rhs)
 
DOCTEST_INTERFACE int regTest (const TestCase &tc)
 
DOCTEST_INTERFACE int setTestSuite (const TestSuite &ts)
 
DOCTEST_INTERFACE bool isDebuggerActive ()
 
template<typename T >
int instantiationHelper (const T &)
 
DOCTEST_INTERFACE void failed_out_of_a_testing_context (const AssertData &ad)
 
DOCTEST_INTERFACE bool decomp_assert (assertType::Enum at, const char *file, int line, const char *expr, const Result &result)
 
template<int comparison, typename L , typename R >
DOCTEST_NOINLINE bool binary_assert (assertType::Enum at, const char *file, int line, const char *expr, const DOCTEST_REF_WRAP(L) lhs, const DOCTEST_REF_WRAP(R) rhs)
 
template<typename L >
DOCTEST_NOINLINE bool unary_assert (assertType::Enum at, const char *file, int line, const char *expr, const DOCTEST_REF_WRAP(L) val)
 
DOCTEST_INTERFACE void registerExceptionTranslatorImpl (const IExceptionTranslator *et)
 
template<typename L >
ContextScope< L > MakeContextScope (const L &lambda)
 
DOCTEST_INTERFACE void registerReporterImpl (const char *name, int prio, reporterCreatorFunc c, bool isReporter)
 
template<typename Reporter >
IReporterreporterCreator (const ContextOptions &o)
 

Variables

struct DOCTEST_INTERFACE TestCase
 

Typedef Documentation

◆ assert_handler

using doctest::detail::assert_handler = void (*)(const AssertData&)

Definition at line 1961 of file doctest.h.

◆ funcType

using doctest::detail::funcType = void (*)()

Definition at line 1613 of file doctest.h.

◆ reporterCreatorFunc

Definition at line 2100 of file doctest.h.

Function Documentation

◆ binary_assert()

template<int comparison, typename L , typename R >
DOCTEST_NOINLINE bool doctest::detail::binary_assert ( assertType::Enum at,
const char * file,
int line,
const char * expr,
const DOCTEST_REF_WRAP(L) lhs,
const DOCTEST_REF_WRAP(R) rhs )

Definition at line 1765 of file doctest.h.

1767 {
1768 bool failed = !RelationalComparator<comparison, L, R>()(lhs, rhs);
1769
1770 // ###################################################################################
1771 // IF THE DEBUGGER BREAKS HERE - GO 1 LEVEL UP IN THE CALLSTACK FOR THE FAILING ASSERT
1772 // THIS IS THE EFFECT OF HAVING 'DOCTEST_CONFIG_SUPER_FAST_ASSERTS' DEFINED
1773 // ###################################################################################
1776 return !failed;
1777 }
#define DOCTEST_ASSERT_IN_TESTS(decomp)
Definition doctest.h:1754
#define DOCTEST_ASSERT_OUT_OF_TESTS(decomp)
Definition doctest.h:1737
String stringifyBinaryExpr(const DOCTEST_REF_WRAP(L) lhs, const char *op, const DOCTEST_REF_WRAP(R) rhs)
Definition doctest.h:1355

References binary_assert(), DOCTEST_ASSERT_IN_TESTS, DOCTEST_ASSERT_OUT_OF_TESTS, and stringifyBinaryExpr().

Referenced by binary_assert().

◆ checkIfShouldThrow()

DOCTEST_INTERFACE bool doctest::detail::checkIfShouldThrow ( assertType::Enum at)

References checkIfShouldThrow().

Referenced by checkIfShouldThrow().

◆ consume()

static DOCTEST_CONSTEXPR int doctest::detail::consume ( const int * ,
int  )
staticnoexcept

Definition at line 447 of file doctest.h.

447{ return 0; }

◆ declval()

template<typename T >
T && doctest::detail::declval ( )

References declval().

Referenced by declval().

◆ decomp_assert()

DOCTEST_INTERFACE bool doctest::detail::decomp_assert ( assertType::Enum at,
const char * file,
int line,
const char * expr,
const Result & result )

References decomp_assert().

Referenced by decomp_assert().

◆ failed_out_of_a_testing_context()

DOCTEST_INTERFACE void doctest::detail::failed_out_of_a_testing_context ( const AssertData & ad)

◆ filloss() [1/2]

template<typename T >
void doctest::detail::filloss ( std::ostream * stream,
const T & in )

Definition at line 1053 of file doctest.h.

1053 {
1054 filldata<T>::fill(stream, in);
1055 }

References filloss().

Referenced by filloss(), filloss(), and toStream().

◆ filloss() [2/2]

template<typename T , size_t N>
void doctest::detail::filloss ( std::ostream * stream,
const T(&) in[N] )

Definition at line 1058 of file doctest.h.

1058 { // NOLINT(*-avoid-c-arrays)
1059 // T[N], T(&)[N], T(&&)[N] have same behaviour.
1060 // Hence remove reference.
1061 filloss<typename types::remove_reference<decltype(in)>::type>(stream, in);
1062 }
void filloss(std::ostream *stream, const T &in)
Definition doctest.h:1053

References filloss().

◆ forward() [1/2]

template<class T >
DOCTEST_CONSTEXPR_FUNC T && doctest::detail::forward ( typename types::remove_reference< T >::type && t)

Definition at line 989 of file doctest.h.

989 {
990 return static_cast<T&&>(t);
991 }

References forward().

◆ forward() [2/2]

template<class T >
DOCTEST_CONSTEXPR_FUNC T && doctest::detail::forward ( typename types::remove_reference< T >::type & t)

Definition at line 984 of file doctest.h.

984 {
985 return static_cast<T&&>(t);
986 }

References forward().

Referenced by forward(), and forward().

◆ instantiationHelper()

template<typename T >
int doctest::detail::instantiationHelper ( const T & )

Definition at line 1654 of file doctest.h.

1654{ return 0; }

References instantiationHelper().

Referenced by instantiationHelper().

◆ isDebuggerActive()

DOCTEST_INTERFACE bool doctest::detail::isDebuggerActive ( )

References isDebuggerActive().

Referenced by isDebuggerActive().

◆ MakeContextScope()

template<typename L >
ContextScope< L > doctest::detail::MakeContextScope ( const L & lambda)

Definition at line 1910 of file doctest.h.

1910 {
1911 return ContextScope<L>(lambda);
1912 }

References MakeContextScope().

Referenced by MakeContextScope().

◆ registerExceptionTranslatorImpl()

DOCTEST_INTERFACE void doctest::detail::registerExceptionTranslatorImpl ( const IExceptionTranslator * et)

◆ registerReporterImpl()

DOCTEST_INTERFACE void doctest::detail::registerReporterImpl ( const char * name,
int prio,
reporterCreatorFunc c,
bool isReporter )

References registerReporterImpl().

Referenced by registerReporterImpl().

◆ regTest()

DOCTEST_INTERFACE int doctest::detail::regTest ( const TestCase & tc)

References regTest().

Referenced by regTest().

◆ reporterCreator()

template<typename Reporter >
IReporter * doctest::detail::reporterCreator ( const ContextOptions & o)

Definition at line 2105 of file doctest.h.

2105 {
2106 return new Reporter(o);
2107 }

References reporterCreator().

Referenced by reporterCreator().

◆ setTestSuite()

DOCTEST_INTERFACE int doctest::detail::setTestSuite ( const TestSuite & ts)

References setTestSuite().

Referenced by setTestSuite().

◆ stringifyBinaryExpr()

template<typename L , typename R >
String doctest::detail::stringifyBinaryExpr ( const DOCTEST_REF_WRAP(L) lhs,
const char * op,
const DOCTEST_REF_WRAP(R) rhs )

Definition at line 1355 of file doctest.h.

1356 {
1357 return (DOCTEST_STRINGIFY(lhs)) + op + (DOCTEST_STRINGIFY(rhs));
1358 }
#define DOCTEST_STRINGIFY(...)
Definition doctest.h:1089

References DOCTEST_STRINGIFY, and stringifyBinaryExpr().

Referenced by binary_assert(), doctest::detail::ResultBuilder::binary_assert(), and stringifyBinaryExpr().

◆ throwException()

DOCTEST_INTERFACE void doctest::detail::throwException ( )

References throwException().

Referenced by throwException().

◆ tlssPop()

DOCTEST_INTERFACE String doctest::detail::tlssPop ( )

References tlssPop().

Referenced by tlssPop(), and toStream().

◆ tlssPush()

DOCTEST_INTERFACE std::ostream * doctest::detail::tlssPush ( )

References tlssPush().

Referenced by tlssPush(), and toStream().

◆ toStream()

template<typename T >
String doctest::detail::toStream ( const T & in)

Definition at line 1065 of file doctest.h.

1065 {
1066 std::ostream* stream = tlssPush();
1067 filloss(stream, in);
1068 return tlssPop();
1069 }
DOCTEST_INTERFACE std::ostream * tlssPush()
DOCTEST_INTERFACE String tlssPop()

References filloss(), tlssPop(), tlssPush(), and toStream().

Referenced by doctest::detail::StringMakerBase< true >::convert(), and toStream().

◆ unary_assert()

template<typename L >
DOCTEST_NOINLINE bool doctest::detail::unary_assert ( assertType::Enum at,
const char * file,
int line,
const char * expr,
const DOCTEST_REF_WRAP(L) val )

OCLINT bitwise operator in conditional

Definition at line 1780 of file doctest.h.

1781 {
1782 bool failed = !val;
1783
1784 if(at & assertType::is_false) //!OCLINT bitwise operator in conditional
1785 failed = !failed;
1786
1787 // ###################################################################################
1788 // IF THE DEBUGGER BREAKS HERE - GO 1 LEVEL UP IN THE CALLSTACK FOR THE FAILING ASSERT
1789 // THIS IS THE EFFECT OF HAVING 'DOCTEST_CONFIG_SUPER_FAST_ASSERTS' DEFINED
1790 // ###################################################################################
1793 return !failed;
1794 }

References DOCTEST_ASSERT_IN_TESTS, DOCTEST_ASSERT_OUT_OF_TESTS, DOCTEST_STRINGIFY, and unary_assert().

Referenced by unary_assert().

Variable Documentation

◆ TestCase

struct DOCTEST_INTERFACE doctest::detail::TestCase

Definition at line 890 of file doctest.h.