ManaPlus
Namespaces | Data Structures | Typedefs | Functions
doctest::detail Namespace Reference

Namespaces

 assertAction
 
 binaryAssertComparison
 
 has_insertion_operator_impl
 

Data Structures

struct  deferred_false
 
struct  has_insertion_operator
 
struct  StringMakerBase
 
struct  StringMakerBase< true >
 
struct  TestFailureException
 
struct  Subcase
 
struct  Result
 
struct  Expression_lhs
 
struct  ExpressionDecomposer
 
struct  TestSuite
 
struct  TestCase
 
struct  RelationalComparator
 
struct  RelationalComparator< 0, L, R >
 
struct  RelationalComparator< 1, L, R >
 
struct  RelationalComparator< 2, L, R >
 
struct  RelationalComparator< 3, L, R >
 
struct  RelationalComparator< 4, L, R >
 
struct  RelationalComparator< 5, L, R >
 
struct  ResultBuilder
 
struct  IExceptionTranslator
 
class  ExceptionTranslator
 OCLINT destructor of virtual class. More...
 
struct  StringStreamBase
 
struct  StringStreamBase< true >
 
struct  StringStream
 
class  ContextBuilder
 
class  ContextScope
 
struct  MessageBuilder
 

Typedefs

typedef void(* funcType) ()
 

Functions

void * getNull ()
 
void my_memcpy (void *dest, const void *src, unsigned num)
 
std::ostream * createStream ()
 
String getStreamResult (std::ostream *)
 
void freeStream (std::ostream *)
 
String rawMemoryToString (const void *object, unsigned size)
 
template<typename T >
String rawMemoryToString (const T &object)
 
template<typename T >
const char * type_to_string ()
 
bool checkIfShouldThrow (assertType::Enum at)
 
void fastAssertThrowIfFlagSet (int flags)
 
const ContextOptionsgetContextOptions ()
 
template<typename L , typename R >
String stringifyBinaryExpr (const L &lhs, const char *op, const R &rhs)
 
DOCTEST_CLANG_SUPPRESS_WARNING_PUSH DOCTEST_CLANG_SUPPRESS_WARNING ("-Wsign-conversion") DOCTEST_CLANG_SUPPRESS_WARNING("-Wsign-compare") DOCTEST_GCC_SUPPRESS_WARNING_PUSH DOCTEST_GCC_SUPPRESS_WARNING("-Wsign-conversion") DOCTEST_GCC_SUPPRESS_WARNING("-Wsign-compare") DOCTEST_MSVC_SUPPRESS_WARNING_PUSH DOCTEST_MSVC_SUPPRESS_WARNING(4388) DOCTEST_MSVC_SUPPRESS_WARNING(4389) DOCTEST_MSVC_SUPPRESS_WARNING(4018) template< typename L
 
DOCTEST_CLANG_SUPPRESS_WARNING_PUSH R bool eq (const L &lhs, const R &rhs)
 
template<typename L , typename R >
bool ne (const L &lhs, const R &rhs)
 
template<typename L , typename R >
bool lt (const L &lhs, const R &rhs)
 
template<typename L , typename R >
bool gt (const L &lhs, const R &rhs)
 
template<typename L , typename R >
bool le (const L &lhs, const R &rhs)
 
template<typename L , typename R >
bool ge (const L &lhs, const R &rhs)
 
int regTest (const TestCase &tc)
 
int setTestSuite (const TestSuite &ts)
 
template<int comparison, typename L , typename R >
 __attribute__ ((noinline)) int fast_binary_assert(assertType
 
template<typename L >
 __attribute__ ((noinline)) int fast_unary_assert(assertType
 
void registerExceptionTranslatorImpl (const IExceptionTranslator *translateFunction)
 
void writeStringToStream (std::ostream *s, const String &str)
 
template<typename T >
void toStream (std::ostream *s, const T &value)
 
void toStream (std::ostream *s, bool in)
 
void toStream (std::ostream *s, float in)
 
void toStream (std::ostream *s, double in)
 
void toStream (std::ostream *s, double long in)
 
void toStream (std::ostream *s, char in)
 
void toStream (std::ostream *s, char signed in)
 
void toStream (std::ostream *s, char unsigned in)
 
void toStream (std::ostream *s, int short in)
 
void toStream (std::ostream *s, int short unsigned in)
 
void toStream (std::ostream *s, int in)
 
void toStream (std::ostream *s, int unsigned in)
 
void toStream (std::ostream *s, int long in)
 
void toStream (std::ostream *s, int long unsigned in)
 
void toStream (std::ostream *s, int long long in)
 
void toStream (std::ostream *s, int long long unsigned in)
 
template<>
const char * type_to_string< bool > ()
 
template<>
const char * type_to_string< float > ()
 
template<>
const char * type_to_string< double > ()
 
template<>
const char * type_to_string< long double > ()
 
template<>
const char * type_to_string< char > ()
 
template<>
const char * type_to_string< signed char > ()
 
template<>
const char * type_to_string< unsigned char > ()
 
template<>
const char * type_to_string< wchar_t > ()
 
template<>
const char * type_to_string< short int > ()
 
template<>
const char * type_to_string< unsigned short int > ()
 
template<>
const char * type_to_string< int > ()
 
template<>
const char * type_to_string< unsigned int > ()
 
template<>
const char * type_to_string< long int > ()
 
template<>
const char * type_to_string< unsigned long int > ()
 
template<>
const char * type_to_string< long long int > ()
 
template<>
const char * type_to_string< unsigned long long int > ()
 

Typedef Documentation

◆ funcType

typedef void(* doctest::detail::funcType) ()

Definition at line 424 of file doctest.h.

Function Documentation

◆ __attribute__() [1/2]

template<int comparison, typename L , typename R >
doctest::detail::__attribute__ ( (noinline)  )

Definition at line 1371 of file doctest.h.

1373  {
1374  ResultBuilder rb(at, file, line, expr);
1375 
1376  rb.m_failed = !RelationalComparator<comparison, L, R>()(lhs, rhs);
1377 
1378  if(rb.m_failed || getContextOptions()->success)
1379  rb.m_decomposition = stringifyBinaryExpr(lhs, ", ", rhs);
1380 
1381  int res = 0;
1382 
1383  if(rb.log())
1384  res |= assertAction::dbgbreak;
1385 
1386  if(rb.m_failed && checkIfShouldThrow(at))
1388 
1389 #ifdef DOCTEST_CONFIG_SUPER_FAST_ASSERTS
1390  // #########################################################################################
1391  // IF THE DEBUGGER BREAKS HERE - GO 1 LEVEL UP IN THE CALLSTACK TO SEE THE FAILING ASSERTION
1392  // THIS IS THE EFFECT OF HAVING 'DOCTEST_CONFIG_SUPER_FAST_ASSERTS' DEFINED
1393  // #########################################################################################
1394  if(res & assertAction::dbgbreak)
1397 #endif // DOCTEST_CONFIG_SUPER_FAST_ASSERTS
1398 
1399  return res;
1400  }
#define DOCTEST_BREAK_INTO_DEBUGGER()
void fastAssertThrowIfFlagSet(int flags)
bool checkIfShouldThrow(assertType::Enum at)
const ContextOptions * getContextOptions()
String stringifyBinaryExpr(const L &lhs, const char *op, const R &rhs)
Definition: doctest.h:1036

References checkIfShouldThrow(), doctest::detail::assertAction::dbgbreak, DOCTEST_BREAK_INTO_DEBUGGER, fastAssertThrowIfFlagSet(), getContextOptions(), doctest::detail::ResultBuilder::log(), doctest::AssertData::m_decomposition, doctest::AssertData::m_failed, doctest::detail::assertAction::shouldthrow, stringifyBinaryExpr(), and doctest::ContextOptions::success.

◆ __attribute__() [2/2]

template<typename L >
doctest::detail::__attribute__ ( (noinline)  )

OCLINT bitwise operator in conditional

Definition at line 1403 of file doctest.h.

1404  {
1405  ResultBuilder rb(at, file, line, val_str);
1406 
1407  rb.m_failed = !val;
1408 
1409  if(at & assertType::is_false)
1410  rb.m_failed = !rb.m_failed;
1411 
1412  if(rb.m_failed || getContextOptions()->success)
1413  rb.m_decomposition = toString(val);
1414 
1415  int res = 0;
1416 
1417  if(rb.log())
1418  res |= assertAction::dbgbreak;
1419 
1420  if(rb.m_failed && checkIfShouldThrow(at))
1422 
1423 #ifdef DOCTEST_CONFIG_SUPER_FAST_ASSERTS
1424  // #########################################################################################
1425  // IF THE DEBUGGER BREAKS HERE - GO 1 LEVEL UP IN THE CALLSTACK TO SEE THE FAILING ASSERTION
1426  // THIS IS THE EFFECT OF HAVING 'DOCTEST_CONFIG_SUPER_FAST_ASSERTS' DEFINED
1427  // #########################################################################################
1428  if(res & assertAction::dbgbreak)
1431 #endif // DOCTEST_CONFIG_SUPER_FAST_ASSERTS
1432 
1433  return res;
1434  }
String toString(const Approx &in)

References checkIfShouldThrow(), doctest::detail::assertAction::dbgbreak, DOCTEST_BREAK_INTO_DEBUGGER, fastAssertThrowIfFlagSet(), getContextOptions(), doctest::assertType::is_false, doctest::detail::ResultBuilder::log(), doctest::AssertData::m_decomposition, doctest::AssertData::m_failed, doctest::detail::assertAction::shouldthrow, and doctest::toString().

◆ checkIfShouldThrow()

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

Referenced by __attribute__().

◆ createStream()

std::ostream* doctest::detail::createStream ( )

◆ DOCTEST_CLANG_SUPPRESS_WARNING()

DOCTEST_CLANG_SUPPRESS_WARNING_PUSH doctest::detail::DOCTEST_CLANG_SUPPRESS_WARNING ( "-Wsign-conversion"  )

◆ eq()

DOCTEST_CLANG_SUPPRESS_WARNING_PUSH R bool doctest::detail::eq ( const L &  lhs,
const R &  rhs 
)

Definition at line 1141 of file doctest.h.

1167 {

◆ fastAssertThrowIfFlagSet()

void doctest::detail::fastAssertThrowIfFlagSet ( int  flags)

Referenced by __attribute__().

◆ freeStream()

void doctest::detail::freeStream ( std::ostream *  )

◆ ge()

template<typename L , typename R >
bool doctest::detail::ge ( const L &  lhs,
const R &  rhs 
)

Definition at line 1146 of file doctest.h.

1167 {

◆ getContextOptions()

const ContextOptions* doctest::detail::getContextOptions ( )

◆ getNull()

void* doctest::detail::getNull ( )
inline

Definition at line 785 of file doctest.h.

785 { return 0; }

◆ getStreamResult()

String doctest::detail::getStreamResult ( std::ostream *  )

◆ gt()

template<typename L , typename R >
bool doctest::detail::gt ( const L &  lhs,
const R &  rhs 
)

Definition at line 1144 of file doctest.h.

1167 {

◆ le()

template<typename L , typename R >
bool doctest::detail::le ( const L &  lhs,
const R &  rhs 
)

Definition at line 1145 of file doctest.h.

1167 {

◆ lt()

template<typename L , typename R >
bool doctest::detail::lt ( const L &  lhs,
const R &  rhs 
)

Definition at line 1143 of file doctest.h.

1167 {

◆ my_memcpy()

void doctest::detail::my_memcpy ( void *  dest,
const void *  src,
unsigned  num 
)

◆ ne()

template<typename L , typename R >
bool doctest::detail::ne ( const L &  lhs,
const R &  rhs 
)

Definition at line 1142 of file doctest.h.

1167 {

◆ rawMemoryToString() [1/2]

template<typename T >
String doctest::detail::rawMemoryToString ( const T &  object)

Definition at line 847 of file doctest.h.

847  {
848  return rawMemoryToString(&object, sizeof(object));
849  }
String rawMemoryToString(const T &object)
Definition: doctest.h:847

Referenced by doctest::StringMaker< R C::* >::convert(), and doctest::StringMaker< T * >::convert().

◆ rawMemoryToString() [2/2]

String doctest::detail::rawMemoryToString ( const void *  object,
unsigned  size 
)

◆ registerExceptionTranslatorImpl()

void doctest::detail::registerExceptionTranslatorImpl ( const IExceptionTranslator translateFunction)

◆ regTest()

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

◆ setTestSuite()

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

◆ stringifyBinaryExpr()

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

Definition at line 1036 of file doctest.h.

1037  {
1038  return toString(lhs) + op + toString(rhs);
1039  }

References doctest::toString().

Referenced by __attribute__().

◆ toStream() [1/16]

void doctest::detail::toStream ( std::ostream *  s,
bool  in 
)

◆ toStream() [2/16]

void doctest::detail::toStream ( std::ostream *  s,
char  in 
)

◆ toStream() [3/16]

void doctest::detail::toStream ( std::ostream *  s,
char signed  in 
)

◆ toStream() [4/16]

void doctest::detail::toStream ( std::ostream *  s,
char unsigned  in 
)

◆ toStream() [5/16]

template<typename T >
void doctest::detail::toStream ( std::ostream *  s,
const T &  value 
)

Definition at line 1504 of file doctest.h.

1504  {
1505  StringStream<T>::convert(s, value);
1506  }

◆ toStream() [6/16]

void doctest::detail::toStream ( std::ostream *  s,
double  in 
)

◆ toStream() [7/16]

void doctest::detail::toStream ( std::ostream *  s,
double long  in 
)

◆ toStream() [8/16]

void doctest::detail::toStream ( std::ostream *  s,
float  in 
)

◆ toStream() [9/16]

void doctest::detail::toStream ( std::ostream *  s,
int  in 
)

◆ toStream() [10/16]

void doctest::detail::toStream ( std::ostream *  s,
int long  in 
)

◆ toStream() [11/16]

void doctest::detail::toStream ( std::ostream *  s,
int long long  in 
)

◆ toStream() [12/16]

void doctest::detail::toStream ( std::ostream *  s,
int long long unsigned  in 
)

◆ toStream() [13/16]

void doctest::detail::toStream ( std::ostream *  s,
int long unsigned  in 
)

◆ toStream() [14/16]

void doctest::detail::toStream ( std::ostream *  s,
int short  in 
)

◆ toStream() [15/16]

void doctest::detail::toStream ( std::ostream *  s,
int short unsigned  in 
)

◆ toStream() [16/16]

void doctest::detail::toStream ( std::ostream *  s,
int unsigned  in 
)

◆ type_to_string()

template<typename T >
const char* doctest::detail::type_to_string ( )

Definition at line 852 of file doctest.h.

852  {
853  return "<>";
854  }

◆ type_to_string< bool >()

template<>
const char* doctest::detail::type_to_string< bool > ( )
inline

Definition at line 2613 of file doctest.h.

2770 {

◆ type_to_string< char >()

template<>
const char* doctest::detail::type_to_string< char > ( )
inline

Definition at line 2617 of file doctest.h.

2770 {

◆ type_to_string< double >()

template<>
const char* doctest::detail::type_to_string< double > ( )
inline

Definition at line 2615 of file doctest.h.

2770 {

◆ type_to_string< float >()

template<>
const char* doctest::detail::type_to_string< float > ( )
inline

Definition at line 2614 of file doctest.h.

2770 {

◆ type_to_string< int >()

template<>
const char* doctest::detail::type_to_string< int > ( )
inline

Definition at line 2623 of file doctest.h.

2770 {

◆ type_to_string< long double >()

template<>
const char* doctest::detail::type_to_string< long double > ( )
inline

Definition at line 2616 of file doctest.h.

2770 {

◆ type_to_string< long int >()

template<>
const char* doctest::detail::type_to_string< long int > ( )
inline

Definition at line 2625 of file doctest.h.

2770 {

◆ type_to_string< long long int >()

template<>
const char* doctest::detail::type_to_string< long long int > ( )
inline

Definition at line 2627 of file doctest.h.

2770 {

◆ type_to_string< short int >()

template<>
const char* doctest::detail::type_to_string< short int > ( )
inline

Definition at line 2621 of file doctest.h.

2770 {

◆ type_to_string< signed char >()

template<>
const char* doctest::detail::type_to_string< signed char > ( )
inline

Definition at line 2618 of file doctest.h.

2770 {

◆ type_to_string< unsigned char >()

template<>
const char* doctest::detail::type_to_string< unsigned char > ( )
inline

Definition at line 2619 of file doctest.h.

2770 {

◆ type_to_string< unsigned int >()

template<>
const char* doctest::detail::type_to_string< unsigned int > ( )
inline

Definition at line 2624 of file doctest.h.

2770 {

◆ type_to_string< unsigned long int >()

template<>
const char* doctest::detail::type_to_string< unsigned long int > ( )
inline

Definition at line 2626 of file doctest.h.

2770 {

◆ type_to_string< unsigned long long int >()

template<>
const char* doctest::detail::type_to_string< unsigned long long int > ( )
inline

Definition at line 2628 of file doctest.h.

2770 {

◆ type_to_string< unsigned short int >()

template<>
const char* doctest::detail::type_to_string< unsigned short int > ( )
inline

Definition at line 2622 of file doctest.h.

2770 {

◆ type_to_string< wchar_t >()

template<>
const char* doctest::detail::type_to_string< wchar_t > ( )
inline

Definition at line 2620 of file doctest.h.

2770 {

◆ writeStringToStream()

void doctest::detail::writeStringToStream ( std::ostream *  s,
const String str 
)