Loading...
Searching...
No Matches
test_tools.h File Reference
Tools and Utilities » Miscellaneous Tools
`#include <iostream>`
`#include <stdlib.h>`

## Macros

#define | check(rc, msg)
| Some utilities to write test programs.

## Macro Definition Documentation

## check

#define check | ( |  | rc,
|  |  | msg )

If `rc` is fail, writes an error message and exits. If `rc` is fail, writes an error message and exits. The error message contains the file name and the line number of the source code in a standard from, which makes it possible to go there using good source browsers like e.g. `emacs`.

For example

check(0==1,"This is obviously false.");
check
#define check(rc, msg)
Some utilities to write test programs.
Definition test_tools.h:40

will print something like this (and then exits).

    file_name.cc:123: error: This is obviously false.