lib: add pre condition asserts to check current thread has no error
[babeltrace.git] / src / lib / graph / message / message-iterator-inactivity.c
index f1b94dd0b5e204d40113f2e92ebe6e09bbff2c38..e5776ae0490fdd982b7c5ab0e296a0a8e8c3bbfe 100644 (file)
@@ -61,6 +61,7 @@ struct bt_message *bt_message_message_iterator_inactivity_create(
        struct bt_message_message_iterator_inactivity *message;
        struct bt_message *ret_msg = NULL;
 
+       BT_ASSERT_PRE_DEV_NO_ERROR();
        BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
        BT_ASSERT_PRE_NON_NULL(default_clock_class, "Default clock class");
        BT_LIB_LOGD("Creating message iterator inactivity message object: "
@@ -68,7 +69,8 @@ struct bt_message *bt_message_message_iterator_inactivity_create(
                default_clock_class, value_cycles);
        message = g_new0(struct bt_message_message_iterator_inactivity, 1);
        if (!message) {
-               BT_LOGE_STR("Failed to allocate one message iterator "
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one message iterator "
                        "inactivity message.");
                goto error;
        }
@@ -100,7 +102,8 @@ bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
 {
        struct bt_message_message_iterator_inactivity *inactivity = (void *) msg;
 
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY);
+       BT_ASSERT_PRE_DEV_NON_NULL(msg, "Message");
+       BT_ASSERT_PRE_DEV_MSG_IS_TYPE(msg,
+               BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY);
        return inactivity->default_cs;
 }
This page took 0.023399 seconds and 4 git commands to generate.