From 88f2b88c3889e9dd0c894d389d67b17617412094 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Mon, 25 Nov 2024 08:28:13 -0700 Subject: wip: libcr_ipc: Add some tests --- libcr_ipc/tests/test.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libcr_ipc/tests/test.h (limited to 'libcr_ipc/tests/test.h') 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 + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +#ifndef _LIBCR_IPC_TESTS_TEST_H_ +#define _LIBCR_IPC_TESTS_TEST_H_ + +#include +#include /* 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_ */ -- cgit v1.2.3-2-g168b