diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-30 02:03:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-30 02:03:32 +0300 |
commit | 244991dee7a2e274cb361f5040dd39b0f2997290 (patch) | |
tree | 1561cedb98b1f2df73fb49cc26f48eb14d01e520 /src/utils/checkutils.cpp | |
parent | 22795c4301cd6b62a8270b45a72a850ed888daf8 (diff) | |
download | mv-244991dee7a2e274cb361f5040dd39b0f2997290.tar.gz mv-244991dee7a2e274cb361f5040dd39b0f2997290.tar.bz2 mv-244991dee7a2e274cb361f5040dd39b0f2997290.tar.xz mv-244991dee7a2e274cb361f5040dd39b0f2997290.zip |
Extend assert reporting functions with condition text and call stack.
Diffstat (limited to 'src/utils/checkutils.cpp')
-rw-r--r-- | src/utils/checkutils.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/utils/checkutils.cpp b/src/utils/checkutils.cpp index 2fc471d7e..6cc3c751e 100644 --- a/src/utils/checkutils.cpp +++ b/src/utils/checkutils.cpp @@ -30,19 +30,25 @@ #include "debug.h" -bool reportFalseReal(const bool val, const char *const file, - const unsigned line) +bool reportFalseReal(const bool val, + const char *const text, + const char *const file, + const unsigned line, + const char *const func) { if (!val) - logger->log("Debug: false value at %s:%u", file, line); + reportStack(file, line, func, "Detected false value", text); return val; } -bool reportTrueReal(const bool val, const char *const file, - const unsigned line) +bool reportTrueReal(const bool val, + const char *const text, + const char *const file, + const unsigned line, + const char *const func) { if (val) - logger->log("Debug: true value at %s:%u", file, line); + reportStack(file, line, func, "Detected true value", text); return val; } @@ -61,7 +67,7 @@ void reportStack(const char *const file, logger->log("--- %s --------------------------------------------", name); - logger->log("%s:%u: '%s' in function `%s'", + logger->assert("%s:%u: '%s' in function `%s'", file, line, text, |