diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-11-25 08:28:13 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-11-26 20:23:53 -0700 |
commit | 88f2b88c3889e9dd0c894d389d67b17617412094 (patch) | |
tree | 2b0f8535735f7eee56cd7ac5abb1d169c9d5e252 /libcr_ipc/tests/test.h | |
parent | a8dc3fc4ad08c159243271c403848d23261aa699 (diff) |
wip: libcr_ipc: Add some tests
Diffstat (limited to 'libcr_ipc/tests/test.h')
-rw-r--r-- | libcr_ipc/tests/test.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libcr_ipc/tests/test.h b/libcr_ipc/tests/test.h new file mode 100644 index 0000000..4928d8d --- /dev/null +++ b/libcr_ipc/tests/test.h @@ -0,0 +1,21 @@ +/* libcr_ipc/tests/test.h - Common test utilities + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +#ifndef _LIBCR_IPC_TESTS_TEST_H_ +#define _LIBCR_IPC_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 /* _LIBCR_IPC_TESTS_TEST_H_ */ |