Merge both files into a single one to make it possible to reuse code.
Specific `BT_ASSERT_PRE*` and `BT_ASSERT_POST*` macros which were
identical are merged into a single one with the `BT_ASSERT_COND*` prefix
now.
No functional changes intended.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I019bcc73d5c644012238775c16b6498d07931a9a
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3428
lib_LTLIBRARIES = libbabeltrace2.la
libbabeltrace2_la_SOURCES = \
- assert-post.h \
- assert-pre.h \
+ assert-cond.h \
babeltrace2.c \
current-thread.c \
error.c \
--- /dev/null
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2018 EfficiOS Inc. and Linux Foundation
+ * Copyright (c) 2018-2020 Philippe Proulx <pproulx@efficios.com>
+ */
+
+#ifndef BABELTRACE_ASSERT_COND_INTERNAL_H
+#define BABELTRACE_ASSERT_COND_INTERNAL_H
+
+/*
+ * The macros in this header use macros defined in "lib/logging.h". We
+ * don't want this header to automatically include "lib/logging.h"
+ * because you need to manually define BT_LOG_TAG before including
+ * "lib/logging.h" and it is unexpected that you also need to define it
+ * before including this header.
+ *
+ * This is a reminder that in order to use "lib/assert-cond.h", you also
+ * need to use logging explicitly.
+ */
+
+#ifndef BT_LIB_LOG_SUPPORTED
+# error Include "lib/logging.h" before this header.
+#endif
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include "common/common.h"
+#include "common/macros.h"
+
+/*
+ * Prints the details of an unsatisfied precondition or postcondition
+ * without immediately aborting. You should use this within a function
+ * which checks preconditions or postconditions, but which is called
+ * from a BT_ASSERT_PRE() or BT_ASSERT_POST() context, so that the
+ * function can still return its result for
+ * BT_ASSERT_PRE()/BT_ASSERT_POST() to evaluate it.
+ *
+ * Example:
+ *
+ * static inline bool check_complex_precond(...)
+ * {
+ * ...
+ *
+ * if (...) {
+ * BT_ASSERT_COND_MSG("Invalid object: ...", ...);
+ * return false;
+ * }
+ *
+ * ...
+ * }
+ *
+ * ...
+ *
+ * BT_ASSERT_PRE(check_complex_precond(...),
+ * "Precondition is not satisfied: ...", ...);
+ */
+#define BT_ASSERT_COND_MSG(_fmt, ...) \
+ do { \
+ bt_lib_log(_BT_LOG_SRCLOC_FUNCTION, __FILE__, \
+ __LINE__, BT_LOG_FATAL, BT_LOG_TAG, \
+ (_fmt), ##__VA_ARGS__); \
+ } while (0)
+
+/*
+ * Internal to this file: asserts that the library condition `_cond` of
+ * type `_cond_type` (`pre` or `post`) is satisfied.
+ *
+ * If `_cond` is false, this macro logs a fatal message using `_fmt` and
+ * the optional arguments (same usage as BT_LIB_LOGF()), and abort.
+ *
+ * To assert that an internal precondition or postcondition is
+ * satisfied, use BT_ASSERT() or BT_ASSERT_DBG().
+ */
+#define _BT_ASSERT_COND(_cond_type, _cond, _fmt, ...) \
+ do { \
+ if (!(_cond)) { \
+ BT_ASSERT_COND_MSG("Babeltrace 2 library " _cond_type "condition not satisfied. Error is:"); \
+ BT_ASSERT_COND_MSG(_fmt, ##__VA_ARGS__); \
+ BT_ASSERT_COND_MSG("Aborting..."); \
+ bt_common_abort(); \
+ } \
+ } while (0)
+
+/*
+ * Asserts that the library precondition `_cond` is satisfied.
+ *
+ * If `_cond` is false, log a fatal message using `_fmt` and the
+ * optional arguments (same usage as BT_LIB_LOGF()), and abort.
+ *
+ * To assert that a library postcondition is satisfied (return from user
+ * code), use BT_ASSERT_POST().
+ *
+ * To assert that an internal precondition or postcondition is
+ * satisfied, use BT_ASSERT() or BT_ASSERT_DBG().
+ */
+#define BT_ASSERT_PRE(_cond, _fmt, ...) \
+ _BT_ASSERT_COND("pre", _cond, _fmt, ##__VA_ARGS__)
+
+/*
+ * Asserts that the library postcondition `_cond` is satisfied.
+ *
+ * If `_cond` is false, log a fatal message using `_fmt` and the
+ * optional arguments (same usage as BT_LIB_LOGF()), and abort.
+ *
+ * To assert that a library precondition is satisfied (return from user
+ * code), use BT_ASSERT_PRE().
+ *
+ * To assert that an internal precondition or postcondition is
+ * satisfied, use BT_ASSERT() or BT_ASSERT_DBG().
+ */
+#define BT_ASSERT_POST(_cond, _fmt, ...) \
+ _BT_ASSERT_COND("post", _cond, _fmt, ##__VA_ARGS__)
+
+/*
+ * Asserts that a given variable `_obj` named `_obj_name` (capitalized)
+ * is not `NULL`.
+ */
+#define BT_ASSERT_PRE_NON_NULL(_obj, _obj_name) \
+ BT_ASSERT_PRE((_obj), "%s is NULL: ", _obj_name)
+
+/*
+ * Asserts that a given index `_index` is less than a given length
+ * `_length`.
+ */
+#define BT_ASSERT_PRE_VALID_INDEX(_index, _length) \
+ BT_ASSERT_PRE((_index) < (_length), \
+ "Index is out of bounds: index=%" PRIu64 ", " \
+ "count=%" PRIu64, (uint64_t) (_index), (uint64_t) (_length))
+
+/*
+ * Asserts that the current thread has no error set.
+ */
+#define BT_ASSERT_PRE_NO_ERROR() \
+ do { \
+ const struct bt_error *err = bt_current_thread_take_error(); \
+ if (err) { \
+ bt_current_thread_move_error(err); \
+ } \
+ BT_ASSERT_PRE(!err, \
+ "API function called while current thread has an " \
+ "error: function=%s", __func__); \
+ } while (0)
+
+/*
+ * Asserts that, if the current thread has an error, `_status` is an
+ * error status code.
+ *
+ * Puts back the error in place (if there is one) such that if this
+ * macro aborts, it will be possible to inspect it with a debugger.
+ */
+#define BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(_status) \
+ do { \
+ const struct bt_error *err = bt_current_thread_take_error(); \
+ if (err) { \
+ bt_current_thread_move_error(err); \
+ } \
+ BT_ASSERT_POST(_status < 0 || !err, \
+ "Current thread has an error, but user function " \
+ "returned a non-error status: status=%s", \
+ bt_common_func_status_string(_status)); \
+ } while (0)
+
+/*
+ * Asserts that the current thread has no error.
+ */
+#define BT_ASSERT_POST_NO_ERROR() \
+ BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(0)
+
+#ifdef BT_DEV_MODE
+/* Developer mode version of BT_ASSERT_PRE(). */
+# define BT_ASSERT_PRE_DEV(_cond, _fmt, ...) \
+ BT_ASSERT_PRE((_cond), _fmt, ##__VA_ARGS__)
+
+/* Developer mode version of BT_ASSERT_PRE_NON_NULL() */
+# define BT_ASSERT_PRE_DEV_NON_NULL(_obj, _obj_name) \
+ BT_ASSERT_PRE_NON_NULL((_obj), (_obj_name))
+
+/*
+ * Developer mode: asserts that a given object `_obj` named `_obj_name`
+ * (capitalized) is NOT frozen. This macro checks the `frozen` field of
+ * `_obj`.
+ *
+ * This currently only exists in developer mode because some freezing
+ * functions can be called on the fast path, so they too are only
+ * enabled in developer mode.
+ */
+# define BT_ASSERT_PRE_DEV_HOT(_obj, _obj_name, _fmt, ...) \
+ BT_ASSERT_PRE(!(_obj)->frozen, "%s is frozen" _fmt, _obj_name, \
+ ##__VA_ARGS__)
+
+/* Developer mode version of BT_ASSERT_PRE_VALID_INDEX() */
+# define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length) \
+ BT_ASSERT_PRE_VALID_INDEX((_index), (_length))
+
+/* Developer mode version of BT_ASSERT_PRE_NO_ERROR(). */
+# define BT_ASSERT_PRE_DEV_NO_ERROR() \
+ BT_ASSERT_PRE_NO_ERROR()
+
+/* Developer mode version of BT_ASSERT_POST(). */
+# define BT_ASSERT_POST_DEV(_cond, _fmt, ...) \
+ BT_ASSERT_POST((_cond), _fmt, ##__VA_ARGS__)
+
+/*
+ * Developer mode version of
+ * BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS().
+ */
+# define BT_ASSERT_POST_DEV_NO_ERROR_IF_NO_ERROR_STATUS(_status) \
+ BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(_status)
+
+/* Developer mode version of BT_ASSERT_POST_NO_ERROR(). */
+# define BT_ASSERT_POST_DEV_NO_ERROR() \
+ BT_ASSERT_POST_NO_ERROR()
+
+/* Developer mode version of BT_ASSERT_COND_MSG(). */
+# define BT_ASSERT_COND_DEV_MSG(_fmt, ...) \
+ BT_ASSERT_COND_MSG(_fmt, ##__VA_ARGS__)
+
+/*
+ * Marks a function as being only used within a BT_ASSERT_PRE_DEV() or
+ * BT_ASSERT_POST_DEV() context.
+ */
+# define BT_ASSERT_COND_DEV_FUNC
+#else
+# define BT_ASSERT_COND_DEV_MSG(_fmt, ...)
+# define BT_ASSERT_PRE_DEV(_cond, _fmt, ...) ((void) sizeof((void) (_cond), 0))
+# define BT_ASSERT_PRE_DEV_NON_NULL(_obj, _obj_name) \
+ ((void) sizeof((void) (_obj), (void) (_obj_name), 0))
+# define BT_ASSERT_PRE_DEV_HOT(_obj, _obj_name, _fmt, ...) \
+ ((void) sizeof((void) (_obj), (void) (_obj_name), 0))
+# define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length) \
+ ((void) sizeof((void) (_index), (void) (_length), 0))
+# define BT_ASSERT_PRE_DEV_NO_ERROR()
+# define BT_ASSERT_POST_DEV(_cond, _fmt, ...) ((void) sizeof((void) (_cond), 0))
+# define BT_ASSERT_POST_DEV_NO_ERROR_IF_NO_ERROR_STATUS(_status) \
+ ((void) sizeof((void) (_status), 0))
+# define BT_ASSERT_POST_DEV_NO_ERROR()
+# define BT_ASSERT_COND_DEV_FUNC __attribute__((unused))
+#endif /* BT_DEV_MODE */
+
+/*
+ * Mark anything that includes this file as supporting precondition and
+ * postcondition assertion macros.
+ */
+#define BT_ASSERT_COND_SUPPORTED
+
+#endif /* BABELTRACE_ASSERT_COND_INTERNAL_H */
+++ /dev/null
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright (c) 2019 EfficiOS Inc. and Linux Foundation
- * Copyright (c) 2019 Philippe Proulx <pproulx@efficios.com>
- */
-
-#ifndef BABELTRACE_ASSERT_POST_INTERNAL_H
-#define BABELTRACE_ASSERT_POST_INTERNAL_H
-
-/*
- * The macros in this header use macros defined in "lib/logging.h".
- * We don't want this header to automatically include
- * "lib/logging.h" because you need to manually define BT_LOG_TAG
- * before including "lib/logging.h" and it is unexpected that you
- * also need to define it before including this header.
- *
- * This is a reminder that in order to use "lib/assert-post.h", you also
- * need to use logging explicitly.
- */
-
-#ifndef BT_LIB_LOG_SUPPORTED
-# error Include "lib/logging.h" before this header.
-#endif
-
-#include <stdbool.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include "common/macros.h"
-#include "common/common.h"
-
-/*
- * Prints the details of an unsatisfied postcondition without
- * immediately aborting. You should use this within a function which
- * checks postconditions, but which is called from a
- * BT_ASSERT_POST() context, so that the function can still return
- * its result for BT_ASSERT_POST() to evaluate it.
- *
- * Example:
- *
- * BT_ASSERT_POST_FUNC
- * static inline bool check_complex_postcond(...)
- * {
- * ...
- *
- * if (...) {
- * BT_ASSERT_POST_MSG("Unexpected status: ...", ...);
- * return false;
- * }
- *
- * ...
- * }
- *
- * ...
- *
- * BT_ASSERT_POST(check_complex_postcond(...),
- * "Postcondition is not satisfied: ...", ...);
- */
-#define BT_ASSERT_POST_MSG(_fmt, ...) \
- do { \
- bt_lib_log(_BT_LOG_SRCLOC_FUNCTION, __FILE__, \
- __LINE__, BT_LOG_FATAL, BT_LOG_TAG, \
- (_fmt), ##__VA_ARGS__); \
- } while (0)
-
-/*
- * Asserts that the library postcondition `_cond` is satisfied.
- *
- * If `_cond` is false, log a fatal statement using `_fmt` and the
- * optional arguments (same usage as BT_LIB_LOGF()), and abort.
- *
- * To assert that a library precondition is satisfied (parameters from
- * the user), use BT_ASSERT_PRE().
- *
- * To assert that an internal postcondition is satisfied, use
- * BT_ASSERT() or BT_ASSERT_DBG().
- */
-#define BT_ASSERT_POST(_cond, _fmt, ...) \
- do { \
- if (!(_cond)) { \
- BT_ASSERT_POST_MSG("Babeltrace 2 library postcondition not satisfied; error is:"); \
- BT_ASSERT_POST_MSG(_fmt, ##__VA_ARGS__); \
- BT_ASSERT_POST_MSG("Aborting..."); \
- bt_common_abort(); \
- } \
- } while (0)
-
-/*
- * Asserts that if there's an error on the current thread, an error status code
- * was returned. Puts back the error in place (if there is one) such that if
- * the assertion hits, it will be possible to inspect it with a debugger.
- */
-#define BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(_status) \
- do { \
- const struct bt_error *err = bt_current_thread_take_error(); \
- if (err) { \
- bt_current_thread_move_error(err); \
- } \
- BT_ASSERT_POST(_status < 0 || !err, \
- "Current thread has an error, but user function " \
- "returned a non-error status: status=%s", \
- bt_common_func_status_string(_status)); \
- } while (0)
-
-/*
- * Asserts that the current thread has no error.
- */
-#define BT_ASSERT_POST_NO_ERROR() \
- BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(0)
-
-/*
- * Marks a function as being only used within a BT_ASSERT_POST()
- * context.
- */
-#define BT_ASSERT_POST_FUNC
-
-#ifdef BT_DEV_MODE
-/* Developer mode version of BT_ASSERT_POST_MSG(). */
-# define BT_ASSERT_POST_DEV_MSG(_fmt, ...) \
- BT_ASSERT_POST_MSG(_fmt, ##__VA_ARGS__)
-
-/* Developer mode version of BT_ASSERT_POST(). */
-# define BT_ASSERT_POST_DEV(_cond, _fmt, ...) \
- BT_ASSERT_POST((_cond), _fmt, ##__VA_ARGS__)
-
-/* Developer mode version of BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(). */
-# define BT_ASSERT_POST_DEV_NO_ERROR_IF_NO_ERROR_STATUS(_status) \
- BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(_status)
-
-/* Developer mode version of `BT_ASSERT_POST_FUNC`. */
-# define BT_ASSERT_POST_DEV_FUNC BT_ASSERT_POST_FUNC
-#else
-# define BT_ASSERT_POST_DEV_MSG(_fmt, ...)
-# define BT_ASSERT_POST_DEV(_cond, _fmt, ...) ((void) sizeof((void) (_cond), 0))
-# define BT_ASSERT_POST_DEV_NO_ERROR_IF_NO_ERROR_STATUS(_status) \
- ((void) sizeof((void) (_status), 0))
-# define BT_ASSERT_POST_DEV_FUNC __attribute__((unused))
-#endif /* BT_DEV_MODE */
-
-#define BT_ASSERT_POST_SUPPORTED
-
-#endif /* BABELTRACE_ASSERT_POST_INTERNAL_H */
+++ /dev/null
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright (c) 2018 EfficiOS Inc. and Linux Foundation
- * Copyright (c) 2018 Philippe Proulx <pproulx@efficios.com>
- */
-
-#ifndef BABELTRACE_ASSERT_PRE_INTERNAL_H
-#define BABELTRACE_ASSERT_PRE_INTERNAL_H
-
-/*
- * The macros in this header use macros defined in "lib/logging.h".
- * We don't want this header to automatically include
- * "lib/logging.h" because you need to manually define BT_LOG_TAG
- * before including "lib/logging.h" and it is unexpected that you
- * also need to define it before including this header.
- *
- * This is a reminder that in order to use "lib/assert-pre.h", you also
- * need to use logging explicitly.
- */
-
-#ifndef BT_LIB_LOG_SUPPORTED
-# error Include "lib/logging.h" before this header.
-#endif
-
-#include <stdbool.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include "common/common.h"
-#include "common/macros.h"
-
-/*
- * Prints the details of an unsatisfied precondition without immediately
- * aborting. You should use this within a function which checks
- * preconditions, but which is called from a BT_ASSERT_PRE() context, so
- * that the function can still return its result for BT_ASSERT_PRE() to
- * evaluate it.
- *
- * Example:
- *
- * static inline bool check_complex_precond(...)
- * {
- * ...
- *
- * if (...) {
- * BT_ASSERT_PRE_MSG("Invalid object: ...", ...);
- * return false;
- * }
- *
- * ...
- * }
- *
- * ...
- *
- * BT_ASSERT_PRE(check_complex_precond(...),
- * "Precondition is not satisfied: ...", ...);
- */
-#define BT_ASSERT_PRE_MSG(_fmt, ...) \
- do { \
- bt_lib_log(_BT_LOG_SRCLOC_FUNCTION, __FILE__, \
- __LINE__, BT_LOG_FATAL, BT_LOG_TAG, \
- (_fmt), ##__VA_ARGS__); \
- } while (0)
-
-/*
- * Asserts that the library precondition `_cond` is satisfied.
- *
- * If `_cond` is false, log a fatal statement using `_fmt` and the
- * optional arguments (same usage as BT_LIB_LOGF()), and abort.
- *
- * To assert that a library postcondition is satisfied (return from user
- * code), use BT_ASSERT_POST().
- *
- * To assert that an internal postcondition is satisfied, use
- * BT_ASSERT() or BT_ASSERT_DBG().
- */
-#define BT_ASSERT_PRE(_cond, _fmt, ...) \
- do { \
- if (!(_cond)) { \
- BT_ASSERT_PRE_MSG("Babeltrace 2 library precondition not satisfied; error is:"); \
- BT_ASSERT_PRE_MSG(_fmt, ##__VA_ARGS__); \
- BT_ASSERT_PRE_MSG("Aborting..."); \
- bt_common_abort(); \
- } \
- } while (0)
-
-/*
- * Asserts that a given variable `_obj` named `_obj_name` (capitalized)
- * is not `NULL`.
- */
-#define BT_ASSERT_PRE_NON_NULL(_obj, _obj_name) \
- BT_ASSERT_PRE((_obj), "%s is NULL: ", _obj_name)
-
-/*
- * Asserts that a given index `_index` is less than a given length
- * `_length`.
- */
-#define BT_ASSERT_PRE_VALID_INDEX(_index, _length) \
- BT_ASSERT_PRE((_index) < (_length), \
- "Index is out of bounds: index=%" PRIu64 ", " \
- "count=%" PRIu64, (uint64_t) (_index), (uint64_t) (_length))
-
-/*
- * Asserts that the current thread has no error set.
- */
-#define BT_ASSERT_PRE_NO_ERROR() \
- do { \
- const struct bt_error *err = bt_current_thread_take_error(); \
- if (err) { \
- bt_current_thread_move_error(err); \
- } \
- BT_ASSERT_PRE(!err, \
- "API function called while current thread has an " \
- "error: function=%s", __func__); \
- } while (0)
-
-#ifdef BT_DEV_MODE
-/* Developer mode version of BT_ASSERT_PRE_MSG(). */
-# define BT_ASSERT_PRE_DEV_MSG(_fmt, ...) \
- BT_ASSERT_PRE_MSG(_fmt, ##__VA_ARGS__)
-
-/* Developer mode version of BT_ASSERT_PRE(). */
-# define BT_ASSERT_PRE_DEV(_cond, _fmt, ...) \
- BT_ASSERT_PRE((_cond), _fmt, ##__VA_ARGS__)
-
-/* Developer mode version of BT_ASSERT_PRE_NON_NULL() */
-# define BT_ASSERT_PRE_DEV_NON_NULL(_obj, _obj_name) \
- BT_ASSERT_PRE_NON_NULL((_obj), (_obj_name))
-
-/*
- * Developer mode: asserts that a given object `_obj` named `_obj_name`
- * (capitalized) is NOT frozen. This macro checks the `frozen` field of
- * `_obj`.
- *
- * This currently only exists in developer mode because some freezing
- * functions can be called on the fast path, so they too are only
- * enabled in developer mode.
- */
-# define BT_ASSERT_PRE_DEV_HOT(_obj, _obj_name, _fmt, ...) \
- BT_ASSERT_PRE(!(_obj)->frozen, "%s is frozen" _fmt, _obj_name, \
- ##__VA_ARGS__)
-
-/* Developer mode version of BT_ASSERT_PRE_VALID_INDEX() */
-# define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length) \
- BT_ASSERT_PRE_VALID_INDEX((_index), (_length))
-
-/* Developer mode version of BT_ASSERT_PRE_NO_ERROR(). */
-# define BT_ASSERT_PRE_DEV_NO_ERROR() \
- BT_ASSERT_PRE_NO_ERROR()
-
-/*
- * Marks a function as being only used within a BT_ASSERT_PRE_DEV()
- * context.
- */
-# define BT_ASSERT_PRE_DEV_FUNC
-#else
-# define BT_ASSERT_PRE_DEV_MSG(_fmt, ...)
-# define BT_ASSERT_PRE_DEV(_cond, _fmt, ...) ((void) sizeof((void) (_cond), 0))
-# define BT_ASSERT_PRE_DEV_NON_NULL(_obj, _obj_name) \
- ((void) sizeof((void) (_obj), (void) (_obj_name), 0))
-# define BT_ASSERT_PRE_DEV_HOT(_obj, _obj_name, _fmt, ...) \
- ((void) sizeof((void) (_obj), (void) (_obj_name), 0))
-# define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length) \
- ((void) sizeof((void) (_index), (void) (_length), 0))
-# define BT_ASSERT_PRE_DEV_NO_ERROR()
-# define BT_ASSERT_PRE_DEV_FUNC __attribute__((unused))
-#endif /* BT_DEV_MODE */
-
-#define BT_ASSERT_PRE_SUPPORTED
-
-#endif /* BABELTRACE_ASSERT_PRE_INTERNAL_H */
#include "error.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "lib/func-status.h"
/*
#include "graph/component.h"
#include "graph/component-class.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "lib/func-status.h"
#define BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(_cause, _exp_type) \
#include "common/assert.h"
#include "common/common.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "lib/object.h"
#include <babeltrace2/graph/component-class.h>
#include <babeltrace2/graph/self-component-port.h>
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "compat/compiler.h"
#include <babeltrace2/graph/component-class.h>
#include <babeltrace2/types.h>
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "compat/compiler.h"
#include "common/common.h"
#include <babeltrace2/types.h>
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "compat/compiler.h"
#include <babeltrace2/value.h>
#include <babeltrace2/graph/self-component.h>
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include "compat/compiler.h"
#include <babeltrace2/value.h>
#include <babeltrace2/graph/self-component.h>
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "compat/compiler.h"
#include <babeltrace2/graph/self-component.h>
#include <babeltrace2/graph/component.h>
#include "common/common.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/graph/self-component.h>
#include <babeltrace2/graph/component.h>
#include <babeltrace2/graph/graph.h>
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/graph/connection.h>
#include "lib/object.h"
#include "compat/compiler.h"
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/graph/graph.h>
#include <babeltrace2/graph/component.h>
#include <babeltrace2/graph/port.h>
struct bt_component *other_comp = graph->components->pdata[i];
if (strcmp(name, bt_component_get_name(other_comp)) == 0) {
- BT_ASSERT_PRE_MSG("Another component with the same name already exists in the graph: "
+ BT_ASSERT_COND_MSG("Another component with the same name already exists in the graph: "
"%![other-comp-]+c, name=\"%s\"",
other_comp, name);
exists = true;
# error Please include "lib/logging.h" before including this file.
#endif
-/* Protection: this file uses BT_ASSERT_PRE*() macros directly */
-#ifndef BT_ASSERT_PRE_SUPPORTED
-# error Please include "lib/assert-pre.h" before including this file.
-#endif
-
-/* Protection: this file uses BT_ASSERT_POST*() macros directly */
-#ifndef BT_ASSERT_POST_SUPPORTED
-# error Please include "lib/assert-post.h" before including this file.
+/*
+ * Protection: this file uses precondition and postcondition assertion
+ * macros directly.
+ */
+#ifndef BT_ASSERT_COND_SUPPORTED
+# error Please include "lib/assert-cond.h" before including this file.
#endif
struct bt_component;
#include <babeltrace2/babeltrace.h>
#include "interrupter.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
static
void destroy_interrupter(struct bt_object *obj)
#include <babeltrace2/graph/message-iterator.h>
#include <babeltrace2/types.h>
#include "common/assert.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
* time.
*/
-BT_ASSERT_POST_DEV_FUNC
+BT_ASSERT_COND_DEV_FUNC
static
bool clock_snapshots_are_monotonic_one(
struct bt_message_iterator *iterator,
return result;
}
-BT_ASSERT_POST_DEV_FUNC
+BT_ASSERT_COND_DEV_FUNC
static
bool clock_snapshots_are_monotonic(
struct bt_message_iterator *iterator,
* stream is compatible with what we've seen before.
*/
-BT_ASSERT_POST_DEV_FUNC
+BT_ASSERT_COND_DEV_FUNC
static
bool clock_classes_are_compatible_one(struct bt_message_iterator *iterator,
const struct bt_message *msg)
case CLOCK_EXPECTATION_NONE:
if (clock_class) {
- BT_ASSERT_POST_DEV_MSG(
+ BT_ASSERT_COND_DEV_MSG(
"Expecting no clock class, got one: %![cc-]+K",
clock_class);
result = false;
case CLOCK_EXPECTATION_ORIGIN_UNIX:
if (!clock_class) {
- BT_ASSERT_POST_DEV_MSG(
+ BT_ASSERT_COND_DEV_MSG(
"Expecting a clock class, got none.");
result = false;
goto end;
}
if (!bt_clock_class_origin_is_unix_epoch(clock_class)) {
- BT_ASSERT_POST_DEV_MSG(
+ BT_ASSERT_COND_DEV_MSG(
"Expecting a clock class with Unix epoch origin: %![cc-]+K",
clock_class);
result = false;
case CLOCK_EXPECTATION_ORIGIN_OTHER_UUID:
if (!clock_class) {
- BT_ASSERT_POST_DEV_MSG(
+ BT_ASSERT_COND_DEV_MSG(
"Expecting a clock class, got none.");
result = false;
goto end;
}
if (bt_clock_class_origin_is_unix_epoch(clock_class)) {
- BT_ASSERT_POST_DEV_MSG(
+ BT_ASSERT_COND_DEV_MSG(
"Expecting a clock class without Unix epoch origin: %![cc-]+K",
clock_class);
result = false;
}
if (!clock_class_uuid) {
- BT_ASSERT_POST_DEV_MSG(
+ BT_ASSERT_COND_DEV_MSG(
"Expecting a clock class with UUID: %![cc-]+K",
clock_class);
result = false;
}
if (bt_uuid_compare(iterator->clock_expectation.uuid, clock_class_uuid)) {
- BT_ASSERT_POST_DEV_MSG(
+ BT_ASSERT_COND_DEV_MSG(
"Expecting a clock class with UUID, got one "
"with a different UUID: %![cc-]+K, expected-uuid=%!u",
clock_class, iterator->clock_expectation.uuid);
case CLOCK_EXPECTATION_ORIGIN_OTHER_NO_UUID:
if (!clock_class) {
- BT_ASSERT_POST_DEV_MSG(
+ BT_ASSERT_COND_DEV_MSG(
"Expecting a clock class, got none.");
result = false;
goto end;
}
if (bt_clock_class_origin_is_unix_epoch(clock_class)) {
- BT_ASSERT_POST_DEV_MSG(
+ BT_ASSERT_COND_DEV_MSG(
"Expecting a clock class without Unix epoch origin: %![cc-]+K",
clock_class);
result = false;
}
if (clock_class_uuid) {
- BT_ASSERT_POST_DEV_MSG(
+ BT_ASSERT_COND_DEV_MSG(
"Expecting a clock class without UUID: %![cc-]+K",
clock_class);
result = false;
return result;
}
-BT_ASSERT_POST_DEV_FUNC
+BT_ASSERT_COND_DEV_FUNC
static
bool clock_classes_are_compatible(
struct bt_message_iterator *iterator,
#include "message-iterator-class.h"
#include "compat/compiler.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "lib/func-status.h"
-#define BT_ASSERT_PRE_DEV_MSG_ITER_CLS_HOT(_msg_iter_cls) \
+#define BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(_msg_iter_cls) \
BT_ASSERT_PRE_DEV_HOT((_msg_iter_cls), \
"Message iterator class", ": %!+I", (_msg_iter_cls))
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
- BT_ASSERT_PRE_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
+ BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.initialize = method;
BT_LIB_LOGD("Set message iterator class's iterator initialization method"
": %!+I", message_iterator_class);
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
- BT_ASSERT_PRE_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
+ BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.finalize = method;
BT_LIB_LOGD("Set message iterator class's finalization method"
": %!+I", message_iterator_class);
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
- BT_ASSERT_PRE_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
+ BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.seek_ns_from_origin = seek_method;
message_iterator_class->methods.can_seek_ns_from_origin = can_seek_method;
BT_LIB_LOGD("Set message iterator class's \"seek nanoseconds from origin\" method"
BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
- BT_ASSERT_PRE_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
+ BT_ASSERT_COND_DEV_MSG_ITER_CLS_HOT(message_iterator_class);
message_iterator_class->methods.seek_beginning = seek_method;
message_iterator_class->methods.can_seek_beginning = can_seek_method;
BT_LIB_LOGD("Set message iterator class's \"seek beginning\" methods"
#include <stdbool.h>
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "lib/object.h"
#include "compat/compiler.h"
#include <babeltrace2/trace-ir/clock-class.h>
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include "compat/compiler.h"
#include "lib/object.h"
#include <babeltrace2/trace-ir/event.h>
#define BT_LOG_TAG "LIB/MSG-MSG-ITER-INACTIVITY"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "lib/object.h"
#include "compat/compiler.h"
#include <babeltrace2/trace-ir/clock-class.h>
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/graph/message.h>
#include "lib/graph/message/message.h"
#include "lib/graph/graph.h"
#include <stdbool.h>
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include "compat/compiler.h"
#include <babeltrace2/trace-ir/packet.h>
#include "lib/trace-ir/packet.h"
#define BT_LOG_TAG "LIB/MSG-STREAM"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "compat/compiler.h"
#include <babeltrace2/trace-ir/clock-snapshot.h>
#include "lib/trace-ir/stream.h"
#define BT_LOG_TAG "LIB/MIP"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include <stdbool.h>
#include <unistd.h>
#include <glib.h>
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/graph/port.h>
#include <babeltrace2/graph/self-component-port.h>
#include "lib/object.h"
#include "common/assert.h"
#include "common/common.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/graph/query-executor.h>
#include <babeltrace2/graph/component-class.h>
#include <babeltrace2/graph/query-executor.h>
#include <babeltrace2/babeltrace.h>
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "common/assert.h"
#include "func-status.h"
#include "integer-range-set.h"
#include <babeltrace2/babeltrace.h>
#include "logging.h"
-#include "assert-pre.h"
-#include "assert-post.h"
+#include "assert-cond.h"
#include "value.h"
#include "integer-range-set.h"
#include "object-pool.h"
#include "trace-ir/trace.h"
#include "trace-ir/utils.h"
#include "error.h"
-#include "assert-pre.h"
#define LIB_LOGGING_BUF_SIZE (4096 * 4)
#include <stdint.h>
#include "common/assert.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "lib/object-pool.h"
int bt_object_pool_initialize(struct bt_object_pool *pool,
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "compat/compiler.h"
#include <babeltrace2/plugin/plugin-dev.h>
#include "lib/graph/component-class.h"
#include "lib/logging.h"
#include "common/assert.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "common/macros.h"
#include "compat/compiler.h"
#include "common/common.h"
#include "common/macros.h"
#include <babeltrace2/value.h>
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "lib/object.h"
#include <babeltrace2/value.h>
#include "lib/value.h"
#define BT_LOG_TAG "LIB/CLOCK-CLASS"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "common/uuid.h"
#include <babeltrace2/trace-ir/clock-class.h>
#include "clock-class.h"
#define BT_LOG_TAG "LIB/CLOCK-SNAPSHOT"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "common/uuid.h"
#include "clock-class.h"
#include "clock-snapshot.h"
#define BT_LOG_TAG "LIB/EVENT-CLASS"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/field-class.h>
#include <babeltrace2/trace-ir/event-class.h>
#include <babeltrace2/trace-ir/stream-class.h>
#ifndef BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H
#define BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/field-class.h>
#include <babeltrace2/trace-ir/field.h>
#include "common/macros.h"
#define BT_LOG_TAG "LIB/EVENT"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/event.h>
#include <babeltrace2/trace-ir/event-class.h>
#include <babeltrace2/trace-ir/stream-class.h>
# error Please include "lib/logging.h" before including this file.
#endif
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "common/macros.h"
#include <babeltrace2/value.h>
#include <babeltrace2/trace-ir/stream-class.h>
#define BT_LOG_TAG "LIB/FIELD-CLASS"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/field-class.h>
#include <babeltrace2/trace-ir/field.h>
#include <babeltrace2/trace-ir/clock-class.h>
#ifndef BABELTRACE_TRACE_IR_FIELD_CLASSES_INTERNAL_H
#define BABELTRACE_TRACE_IR_FIELD_CLASSES_INTERNAL_H
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/clock-class.h>
#include <babeltrace2/trace-ir/field-class.h>
#include "common/macros.h"
#define BT_LOG_TAG "LIB/FIELD-PATH"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/field-class.h>
#include <babeltrace2/trace-ir/field-path.h>
#include <limits.h>
#define BT_LOG_TAG "LIB/FIELD"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/field.h>
#include "lib/object.h"
#include "compat/compiler.h"
#ifndef BABELTRACE_TRACE_IR_FIELDS_INTERNAL_H
#define BABELTRACE_TRACE_IR_FIELDS_INTERNAL_H
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "common/common.h"
#include "lib/object.h"
#include "common/macros.h"
#define BT_LOG_TAG "LIB/PACKET"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/packet.h>
#include <babeltrace2/trace-ir/trace.h>
#include <babeltrace2/trace-ir/stream-class.h>
#define BT_LOG_TAG "LIB/RESOLVE-FIELD-PATH"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include "common/assert.h"
#include <babeltrace2/trace-ir/field-path.h>
#include <limits.h>
return field_path;
}
-BT_ASSERT_PRE_DEV_FUNC
+BT_ASSERT_COND_DEV_FUNC
static inline
bool target_is_before_source(struct bt_field_path *src_field_path,
struct bt_field_path *tgt_field_path)
return is_valid;
}
-BT_ASSERT_PRE_DEV_FUNC
+BT_ASSERT_COND_DEV_FUNC
static inline
struct bt_field_class *borrow_root_field_class(
struct bt_resolve_field_path_context *ctx, enum bt_field_path_scope scope)
return NULL;
}
-BT_ASSERT_PRE_DEV_FUNC
+BT_ASSERT_COND_DEV_FUNC
static inline
struct bt_field_class *borrow_child_field_class(
struct bt_field_class *parent_fc,
return child_fc;
}
-BT_ASSERT_PRE_DEV_FUNC
+BT_ASSERT_COND_DEV_FUNC
static inline
bool target_field_path_in_different_scope_has_struct_fc_only(
struct bt_field_path *src_field_path,
return is_valid;
}
-BT_ASSERT_PRE_DEV_FUNC
+BT_ASSERT_COND_DEV_FUNC
static inline
bool lca_is_structure_field_class(struct bt_field_path *src_field_path,
struct bt_field_path *tgt_field_path,
return is_valid;
}
-BT_ASSERT_PRE_DEV_FUNC
+BT_ASSERT_COND_DEV_FUNC
static inline
bool lca_to_target_has_struct_fc_only(struct bt_field_path *src_field_path,
struct bt_field_path *tgt_field_path,
return is_valid;
}
-BT_ASSERT_PRE_DEV_FUNC
+BT_ASSERT_COND_DEV_FUNC
static inline
bool field_path_is_valid(struct bt_field_class *src_fc,
struct bt_field_class *tgt_fc,
tgt_fc, ctx);
if (!src_field_path) {
- BT_ASSERT_PRE_DEV_MSG("Cannot find requesting field class in "
+ BT_ASSERT_COND_DEV_MSG("Cannot find requesting field class in "
"resolving context: %!+F", src_fc);
is_valid = false;
goto end;
}
if (!tgt_field_path) {
- BT_ASSERT_PRE_DEV_MSG("Cannot find target field class in "
+ BT_ASSERT_COND_DEV_MSG("Cannot find target field class in "
"resolving context: %!+F", tgt_fc);
is_valid = false;
goto end;
/* Target must be before source */
if (!target_is_before_source(src_field_path, tgt_field_path)) {
- BT_ASSERT_PRE_DEV_MSG("Target field class is located after "
+ BT_ASSERT_COND_DEV_MSG("Target field class is located after "
"requesting field class: %![req-fc-]+F, %![tgt-fc-]+F",
src_fc, tgt_fc);
is_valid = false;
*/
if (!target_field_path_in_different_scope_has_struct_fc_only(
src_field_path, tgt_field_path, ctx)) {
- BT_ASSERT_PRE_DEV_MSG("Target field class is located in a "
+ BT_ASSERT_COND_DEV_MSG("Target field class is located in a "
"different scope than requesting field class, "
"but within an array or a variant field class: "
"%![req-fc-]+F, %![tgt-fc-]+F",
/* Same scope: LCA must be a structure field class */
if (!lca_is_structure_field_class(src_field_path, tgt_field_path, ctx)) {
- BT_ASSERT_PRE_DEV_MSG("Lowest common ancestor of target and "
+ BT_ASSERT_COND_DEV_MSG("Lowest common ancestor of target and "
"requesting field classes is not a structure field class: "
"%![req-fc-]+F, %![tgt-fc-]+F",
src_fc, tgt_fc);
/* Same scope: path from LCA to target has no array/variant FTs */
if (!lca_to_target_has_struct_fc_only(src_field_path, tgt_field_path,
ctx)) {
- BT_ASSERT_PRE_DEV_MSG("Path from lowest common ancestor of target "
+ BT_ASSERT_COND_DEV_MSG("Path from lowest common ancestor of target "
"and requesting field classes to target field class "
"contains an array or a variant field class: "
"%![req-fc-]+F, %![tgt-fc-]+F", src_fc, tgt_fc);
#define BT_LOG_TAG "LIB/STREAM-CLASS"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/trace.h>
#include "compat/compiler.h"
#include "common/align.h"
#define BT_LOG_TAG "LIB/STREAM"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/stream.h>
#include <babeltrace2/trace-ir/stream-class.h>
#include <babeltrace2/trace-ir/trace.h>
#define BT_LOG_TAG "LIB/TRACE-CLASS"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/trace-class.h>
#include <babeltrace2/trace-ir/event-class.h>
#include "ctf-writer/functor.h"
#ifndef BABELTRACE_TRACE_IR_TRACE_CLASS_INTERNAL_H
#define BABELTRACE_TRACE_IR_TRACE_CLASS_INTERNAL_H
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/trace-class.h>
#include <babeltrace2/trace-ir/field-class.h>
#include <babeltrace2/trace-ir/field.h>
#define BT_LOG_TAG "LIB/TRACE"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/trace.h>
#include <babeltrace2/trace-ir/event-class.h>
#include "ctf-writer/functor.h"
#ifndef BABELTRACE_TRACE_IR_TRACE_INTERNAL_H
#define BABELTRACE_TRACE_IR_TRACE_INTERNAL_H
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <babeltrace2/trace-ir/trace.h>
#include <babeltrace2/trace-ir/field-class.h>
#include <babeltrace2/trace-ir/field.h>
#define BT_LOG_TAG "LIB/UTIL"
#include "lib/logging.h"
-#include "lib/assert-pre.h"
+#include "lib/assert-cond.h"
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "compat/compiler.h"
#include "common/common.h"
#include "compat/glib.h"
-#include "lib/assert-pre.h"
-#include "lib/assert-post.h"
+#include "lib/assert-cond.h"
#include "lib/value.h"
#include "common/assert.h"
#include "func-status.h"