]>
git.proxmox.com Git - mirror_lxc.git/blob - src/tests/lxctest.h
2 * lxc: linux Container library
4 * Copyright © 2016 Canonical Ltd.
7 * Christian Brauner <christian.brauner@mailbox.org>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
31 #define lxc_debug_stream(stream, format, ...) \
33 fprintf(stream, "%s: %d: %s: " format, __FILE__, __LINE__, \
34 __func__, __VA_ARGS__); \
37 #define lxc_error(format, ...) lxc_debug_stream(stderr, format, __VA_ARGS__)
38 #define lxc_debug(format, ...) lxc_debug_stream(stdout, format, __VA_ARGS__)
40 #define lxc_test_assert_stringify(expression, stringify_expression) \
42 if (!(expression)) { \
43 fprintf(stderr, "%s: %s: %d: %s\n", __FILE__, \
44 __func__, __LINE__, stringify_expression); \
49 #define lxc_test_assert_abort(expression) lxc_test_assert_stringify(expression, #expression)
51 #endif /* __LXC_TEST_H */