ONPOSIX  2.0
 All Classes Namespaces Files Functions Variables Enumerator Friends Macros Pages
Assert.hpp File Reference
#include <iostream>
#include <cstdlib>
Include dependency graph for Assert.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define VERIFY_ASSERTION(expr)
 Macro to evaluate an expression.

Functions

void AssertionFailedMsg (const char *expr, const char *file, int line)
 It prints the failed message and aborts the execution.

Macro Definition Documentation

#define VERIFY_ASSERTION (   expr)
Value:
(expr ? static_cast<void>(0) : AssertionFailedMsg(#expr, __FILE__,\
__LINE__))

Macro to evaluate an expression.

If the expression evaluates to false then the AssertionFailedMsg function is called.

Definition at line 47 of file Assert.hpp.

Function Documentation

void AssertionFailedMsg ( const char *  expr,
const char *  file,
int  line 
)
inline

It prints the failed message and aborts the execution.

This function is not meant to be used directly. Use VERIFY_ASSERTION.

Parameters
exprThe expression that has been evaluated.
fileThe file containing the evaluated expression.
lineThe line that contains the evaluated expression.

Definition at line 35 of file Assert.hpp.

{
std::cerr << "Assertion \"" << expr << "\" failed [" << file << ":"
<< line << "]" << std::endl;
std::abort();
}