Viewing is open to everyone. Downloading and starring need a GitHub sign-in. Sign in with GitHub

check.h

v0.1.0-build.85 Latest Commit ede38f5

Size
797 B
Lines
17
Language
cpp
SHA-256
da2aed2dc78a…
View on GitHub

Sign in with GitHub to download. Each download is recorded with your GitHub username.

1#ifndef CKEY_TESTS_CHECK_H
2#define CKEY_TESTS_CHECK_H
3
4#include <cstdio>
5#include <cstdlib>
6
7/* Always-on test assertion. Unlike assert(), it is not compiled out by
8 * NDEBUG, so Release CI builds execute every check. */
9#define CKEY_CHECK(condition) \
10 do { \
11 if (!(condition)) { \
12 std::fprintf(stderr, "%s:%d: check failed: %s\n", __FILE__, __LINE__, #condition); \
13 std::exit(1); \
14 } \
15 } while (0)
16
17#endif