In the debug build, use assertion macros to terminate the application and log the error message when the assertion is failed. More...
Macros | |
#define | kzAssert(expression) |
In the debug build, if assertion expression evaluates to false, use this macro to terminate the application and log the error message. More... | |
#define | kzAssertMessage(expression, message) |
In the debug build, if the assertion expression evaluates to false, use this macro to terminate the application and log the error message including the description message you provided. More... | |
#define | kzAssertUnreachable() |
In the debug build, use this macro to terminate the application and log the error message. More... | |
#define | kzAssertUnreachableMessage(message) |
In the debug build, use this macro to terminate the application and log the error message including the description message you provided. More... | |
#define | kzDebugBreak() |
In the debug build, when you attach the debugger, use this macro to trigger a breakpoint. More... | |
In the debug build, use assertion macros to terminate the application and log the error message when the assertion is failed.
To assert expressions use kzAssert and kzAssertMessage macros.
To assert unreachable code paths use kzAssertUnreachable and kzAssertUnreachableMessage.
To insert a breakpoint use kzDebugBreak.
#define kzAssert | ( | expression | ) |
In the debug build, if assertion expression evaluates to false, use this macro to terminate the application and log the error message.
The error message includes the file name and the line number where the assertion failed.
If you want to include in the error message the description, which makes it easier to understand why assertion failed, use kzAssertMessage.
For compile-time assertion, use KZ_STATIC_ASSERT.
expression | The assertion expression. |
To terminate an application when assertion fails:
#define kzAssertMessage | ( | expression, | |
message | |||
) |
In the debug build, if the assertion expression evaluates to false, use this macro to terminate the application and log the error message including the description message you provided.
The error message includes the description message
you provided and the file name and the line number where the assertion failed.
For compile-time assertion, use KZ_STATIC_ASSERT.
expression | The assertion expression. |
message | The description message you want to include in the error message. For the format description see Log message formating. |
To terminate an application when assertion fails and include in the log message a description of why the assertion failed:
#define kzAssertUnreachable | ( | ) |
In the debug build, use this macro to terminate the application and log the error message.
Use this macro to assert the execution of the code which must not be reached by any valid code path. The error message includes the file name and the line number where the assertion failed.
If you want to include in the error message additional description message, which makes it easier to understand why the assertion failed, use kzAssertUnreachableMessage.
To terminate an application and write an error message:
#define kzAssertUnreachableMessage | ( | message | ) |
In the debug build, use this macro to terminate the application and log the error message including the description message you provided.
The error message includes the description message
you provided and the file name and the line number where the assertion failed.
message | The description message you want to include in the error message. For the format description see Log message formating. |
To terminate an application when assertion fails and include in the log message a description of why the assertion failed:
#define kzDebugBreak | ( | ) |
In the debug build, when you attach the debugger, use this macro to trigger a breakpoint.
If you do not attach the debugger, the execution continues without interruption.