Add support for verbose asserts.

Use for test/exec DoCommand mismatches.
This commit is contained in:
Jonathan G Rennison
2016-02-16 18:27:21 +00:00
parent f86b5c58cb
commit 48e4c35fdc
4 changed files with 74 additions and 1 deletions

View File

@@ -123,6 +123,25 @@ void CDECL error(const char *s, ...)
abort();
}
void CDECL assert_msg_error(int line, const char *file, const char *expr, const char *str, ...)
{
va_list va;
char buf[2048];
char *b = buf;
b += seprintf(b, lastof(buf), "Assertion failed at line %i of %s: %s\n\t", line, file, expr);
va_start(va, str);
vseprintf(b, lastof(buf), str, va);
va_end(va);
ShowOSErrorBox(buf, true);
/* Set the error message for the crash log and then invoke it. */
CrashLog::SetErrorMessage(buf);
abort();
}
/**
* Shows some information on the console/a popup box depending on the OS.
* @param str the text to show.