Fabcoin Core  0.16.2
P2P Digital Currency
Namespaces | Macros | Typedefs | Functions
Assertions.h File Reference
#include "Exceptions.h"
#include "debugbreak.h"
Include dependency graph for Assertions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 dev
 Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Originally by RenĂ© Nyffenegger.
 

Macros

#define ETH_FUNC   __func__
 
#define asserts(A)   ::dev::assertAux(A, #A, __LINE__, __FILE__, ETH_FUNC)
 
#define assertsEqual(A, B)   ::dev::assertEqualAux(A, B, #A, #B, __LINE__, __FILE__, ETH_FUNC)
 
#define assertThrow(_condition, _ExceptionType, _description)   ::dev::assertThrowAux<_ExceptionType>(_condition, _description, __LINE__, __FILE__, ETH_FUNC)
 Assertion that throws an exception containing the given description if it is not met. More...
 

Typedefs

using dev::errinfo_comment = boost::error_info< struct tag_comment, std::string >
 

Functions

bool dev::assertAux (bool _a, char const *_aStr, unsigned _line, char const *_file, char const *_func)
 
template<class A , class B >
bool dev::assertEqualAux (A const &_a, B const &_b, char const *_aStr, char const *_bStr, unsigned _line, char const *_file, char const *_func)
 
template<class _ExceptionType >
void dev::assertThrowAux (bool _condition,::std::string const &_errorDescription, unsigned _line, char const *_file, char const *_function)
 
template<class _ExceptionType >
void dev::assertThrowAux (void const *_pointer,::std::string const &_errorDescription, unsigned _line, char const *_file, char const *_function)
 

Detailed Description

Author
Christian c@eth.nosp@m.dev..nosp@m.com
Date
2015

Assertion handling.

Definition in file Assertions.h.

Macro Definition Documentation

#define asserts (   A)    ::dev::assertAux(A, #A, __LINE__, __FILE__, ETH_FUNC)

Definition at line 41 of file Assertions.h.

#define assertsEqual (   A,
 
)    ::dev::assertEqualAux(A, B, #A, #B, __LINE__, __FILE__, ETH_FUNC)

Definition at line 42 of file Assertions.h.

#define assertThrow (   _condition,
  _ExceptionType,
  _description 
)    ::dev::assertThrowAux<_ExceptionType>(_condition, _description, __LINE__, __FILE__, ETH_FUNC)

Assertion that throws an exception containing the given description if it is not met.

Use it as assertThrow(1 == 1, ExceptionType, "Mathematics is wrong."); Do NOT supply an exception object as the second parameter.

Definition at line 75 of file Assertions.h.

#define ETH_FUNC   __func__

Definition at line 38 of file Assertions.h.