Replace assert() -> BT_ASSERT() and some preconditions with BT_ASSERT_PRE()
[babeltrace.git] / include / babeltrace / graph / notification-internal.h
index 631d0adf7bbfe4c53c51afcb6c25415d126bfda9..c37d2f10b4c0a65beee806e43644038c8caeef05 100644 (file)
@@ -44,6 +44,12 @@ struct bt_notification {
        bt_bool frozen;
 };
 
+#define BT_ASSERT_PRE_NOTIF_IS_TYPE(_notif, _type)                     \
+       BT_ASSERT_PRE((_notif)->type == (_type),                        \
+               "Notification has the wrong type: expected-type=%s, "   \
+               "%![notif-]+n", bt_notification_type_string(_type),     \
+               (_notif))
+
 BT_HIDDEN
 void bt_notification_init(struct bt_notification *notification,
                enum bt_notification_type type,
This page took 0.024873 seconds and 4 git commands to generate.