Ethereum  PoC-8
The C++ Implementation of Ethereum
Assertions.h File Reference
#include <boost/exception/info.hpp>
#include <iostream>

Go to the source code of this file.

Namespaces

 dev
 

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)
 

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

◆ asserts

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

Definition at line 42 of file Assertions.h.

◆ assertsEqual

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

Definition at line 43 of file Assertions.h.

◆ assertThrow

#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 67 of file Assertions.h.

◆ ETH_FUNC

#define ETH_FUNC   __func__

Definition at line 39 of file Assertions.h.