03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * lxc: linux Container library
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * Copyright © 2016 Canonical Ltd.
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * Christian Brauner <christian.brauner@mailbox.org>
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * This program is free software; you can redistribute it and/or
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * modify it under the terms of the GNU Lesser General Public
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * License as published by the Free Software Foundation; either
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * version 2.1 of the License, or (at your option) any later version.
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * This program is distributed in the hope that it will be useful,
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * but WITHOUT ANY WARRANTY; without even the implied warranty of
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * Lesser General Public License for more details.
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * You should have received a copy of the GNU Lesser General Public
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * License along with this program; if not, write to the Free Software
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
8511da278af54cd754ca774c35869541bc7d8126Christian Brauner#define lxc_debug_stream(stream, format, ...) \
8511da278af54cd754ca774c35869541bc7d8126Christian Brauner fprintf(stream, "%s: %d: %s: " format, __FILE__, __LINE__, \
8511da278af54cd754ca774c35869541bc7d8126Christian Brauner } while (false)
8511da278af54cd754ca774c35869541bc7d8126Christian Brauner#define lxc_error(format, ...) lxc_debug_stream(stderr, format, __VA_ARGS__)
8511da278af54cd754ca774c35869541bc7d8126Christian Brauner#define lxc_debug(format, ...) lxc_debug_stream(stdout, format, __VA_ARGS__)
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner#define lxc_test_assert_stringify(expression, stringify_expression) \
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner fprintf(stderr, "%s: %s: %d: %s\n", __FILE__, \
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner __func__, __LINE__, stringify_expression); \
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner } while (false)
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner#define lxc_test_assert_abort(expression) lxc_test_assert_stringify(expression, #expression)
03d3bbc95dfc882e03764c1d7a06427de6ea40b9Christian Brauner#endif /* __LXC_TEST_H */