Enables the use of assertion in a plugin.
void
INKAssert(
expression
);
A boolean expression.
In debug
mode, causes the Traffic Server to print the file
name, line number, and expression before it aborts.
In optim
mode, the expression is not removed, but the
effects of printing an error message and aborting are. This is an
artifact of the way the system assert is normally used and
permits:
ink_assert(!setsockopt(...));
Note: when using the system “assert”, you do not need
to worry about the condition since the code will be 'dead code
eliminated' by the compiler; with INKAssert
, you
do.
switch (event) { case EVENT_IMMEDIATE: .... default: INKAssert (!setsockopt(...)); break; }