diff options
Diffstat (limited to 'src/utils/checkutils.cpp')
-rw-r--r-- | src/utils/checkutils.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/utils/checkutils.cpp b/src/utils/checkutils.cpp index 4953314e1..3161c8f46 100644 --- a/src/utils/checkutils.cpp +++ b/src/utils/checkutils.cpp @@ -52,6 +52,34 @@ bool reportTrueReal(const bool val, return val; } +bool failFalseReal(const bool val, + const char *const text, + const char *const file, + const unsigned line, + const char *const func) +{ + if (!val) + { + reportStack(file, line, func, "Detected false value", text); + throw new std::exception; + } + return val; +} + +bool failTrueReal(const bool val, + const char *const text, + const char *const file, + const unsigned line, + const char *const func) +{ + if (val) + { + reportStack(file, line, func, "Detected true value", text); + throw new std::exception; + } + return val; +} + void reportStack(const char *const file, const unsigned int line, const char *const func, |