libDwm-0.9.45
DwmUnitAssert.hh File Reference

Dwm::Assertions class definition and UnitAssert() macro for unit tests. More...

#include <cstdint>
#include <iostream>
#include <map>
#include <mutex>
#include <string>
Include dependency graph for DwmUnitAssert.hh:

Go to the source code of this file.

Classes

class  Dwm::AssertionCounter
 Holds 'passed' and 'failed' counters. More...
 
class  Dwm::Assertion
 Holds assertion information. More...
 
class  Dwm::FunctionAssertions
 A container class to hold all assertions called from a single function. More...
 
class  Dwm::FileAssertions
 A container class to hold all assertions called from a single source file. More...
 
class  Dwm::Assertions
 A container to hold all assertions. Note everything is static here. More...
 

Macros

#define UnitAssert(e)
 This macro is used just like assert(), but populates Assertions so we can report results at the end of tests using the members of Assertions.
 

Detailed Description

Dwm::Assertions class definition and UnitAssert() macro for unit tests.

Macro Definition Documentation

◆ UnitAssert

#define UnitAssert ( e)
Value:
((e) ? \
Dwm::Assertions::Passed(__FILE__, __PRETTY_FUNCTION__, __LINE__, #e) : \
Dwm::Assertions::Failed(__FILE__, __PRETTY_FUNCTION__, __LINE__, #e))
static bool Passed(const std::string &filename, const std::string &function, int lineNumber, const std::string &test)
Adds a passed assertion.

This macro is used just like assert(), but populates Assertions so we can report results at the end of tests using the members of Assertions.