blob: ea13d3c1d21b017134201c835fae2c4258579ee0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
/* libmisc/tests/test.h - Common test utilities
*
* Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#ifndef _LIBMISC_TESTS_TEST_H_
#define _LIBMISC_TESTS_TEST_H_
#include <stdio.h>
#include <stdlib.h> /* for exit() */
#define test_assert(expr) do { \
if (!(expr)) { \
printf("test failure: %s:%d:%s: %s\n", \
__FILE__, __LINE__, __func__, #expr); \
exit(1); \
} \
} while (0)
#endif /* _LIBMISC_TESTS_TEST_H_ */
|