Version 1 (modified by sam, 7 years ago) (diff)

first version of the assert.h doc

<lol/base/assert.h>

View this file in the source browser: trunk/src/lol/base/assert.h

This file defines the following macro:

#define ASSERT(...) /* ... */

It can be used in the following three different ways:

ASSERT(K == 0);
ASSERT(K == 0, "K is non-zero!\n");
ASSERT(K == 0, "K is %d at iteration %d\n", K, i);

If the test fails, one of the following messages is printed depending on what macro was used:

Error: assertion failure: K == 0
Error: assertion failure: K is non-zero!
Error: assertion failure: K is 42 at iteration 12