Version 2 (modified by sam, 53 years ago) (diff)

Name changed from doc/lol/sys/assert.h to 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