PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
phoenix_assert.h File Reference
#include <assert.h>
#include <string>
+ Include dependency graph for phoenix_assert.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __ASSERT_FUNCTION   __func__
 
#define phoenix_assert(isOk)   phoenix_assertFull(isOk, #isOk, __FILE__, __LINE__, __ASSERT_FUNCTION)
 

Functions

void phoenix_assertFull (bool isOk, const std::string &assertion, const std::string &fileName, size_t line, const std::string &functionName)
 Check if the assertion isOk is true, raise an assertion if isOk is false. More...
 

Macro Definition Documentation

◆ __ASSERT_FUNCTION

#define __ASSERT_FUNCTION   __func__

Definition at line 16 of file phoenix_assert.h.

◆ phoenix_assert

#define phoenix_assert (   isOk)    phoenix_assertFull(isOk, #isOk, __FILE__, __LINE__, __ASSERT_FUNCTION)

Definition at line 19 of file phoenix_assert.h.

Function Documentation

◆ phoenix_assertFull()

void phoenix_assertFull ( bool  isOk,
const std::string &  assertion,
const std::string &  fileName,
size_t  line,
const std::string &  functionName 
)

Check if the assertion isOk is true, raise an assertion if isOk is false.

Parameters
isOk: assertion which has to be true
assertion: text assertion (convertion of isOk expression into text)
fileName: name of the file where the test is called
line: line of the file where the test is called
functionName: name of the function where the problem happends

Definition at line 16 of file phoenix_assert.cpp.

16  {
17  if(!isOk){__assert_fail(assertion.c_str(), fileName.c_str(), line, functionName.c_str());}
18 }