Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
assertions.hh File Reference
#include <string_view>
#include <sys/cdefs.h>
Include dependency graph for assertions.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Scroom
 
namespace  Scroom::Utils
 
namespace  Scroom::Utils::Detail
 

Macros

#define require(expr)
 
#define ensure(expr)
 
#define verify(expr)
 
#define defect()
 
#define defect_message(m)
 

Functions

void Scroom::Utils::Detail::assertionFailed (std::string_view type, std::string_view expr, std::string_view function, std::string_view filename, unsigned int line) __attribute__((noreturn))
 

Macro Definition Documentation

◆ defect

#define defect ( )
Value:
"control flow assertion", "", static_cast<const char*>(__PRETTY_FUNCTION__), __FILE__, __LINE__ \
)
void assertionFailed(std::string_view type, std::string_view expr, std::string_view function, std::string_view filename, unsigned int line) __attribute__((noreturn))
Definition assertions.cc:51

◆ defect_message

#define defect_message (   m)
Value:
"control flow assertion", (m), static_cast<const char*>(__PRETTY_FUNCTION__), __FILE__, __LINE__ \
)

◆ ensure

#define ensure (   expr)
Value:
((expr) ? ((void)0) \
: Scroom::Utils::Detail::assertionFailed( \
"postcondition", __STRING(expr), static_cast<const char*>(__PRETTY_FUNCTION__), __FILE__, __LINE__ \
))
Definition color.hh:26
Definition blockallocator.hh:18
38 "postcondition", __STRING(expr), static_cast<const char*>(__PRETTY_FUNCTION__), __FILE__, __LINE__ \
39 ))

◆ require

#define require (   expr)
Value:
((expr) ? ((void)0) \
: Scroom::Utils::Detail::assertionFailed( \
"precondition", __STRING(expr), static_cast<const char*>(__PRETTY_FUNCTION__), __FILE__, __LINE__ \
))
33 "precondition", __STRING(expr), static_cast<const char*>(__PRETTY_FUNCTION__), __FILE__, __LINE__ \
34 ))

◆ verify

#define verify (   expr)
Value:
((expr) ? ((void)0) \
: Scroom::Utils::Detail::assertionFailed( \
"assertion", __STRING(expr), static_cast<const char*>(__PRETTY_FUNCTION__), __FILE__, __LINE__ \
))
43 "assertion", __STRING(expr), static_cast<const char*>(__PRETTY_FUNCTION__), __FILE__, __LINE__ \
44 ))