lib: add pre condition asserts to check current thread has no error
[babeltrace.git] / src / lib / graph / mip.c
index 887ae157b805ce24effd901147f33e7bb3670a4d..a4704c5d51a0efbe5f8fd247e0fa2aef92e8f7bd 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "lib/assert-pre.h"
 #include "lib/assert-post.h"
+#include <stdbool.h>
 #include <unistd.h>
 #include <glib.h>
 #include <babeltrace2/graph/mip.h>
@@ -115,7 +116,7 @@ int validate_operative_mip_version_in_array(GPtrArray *descriptors,
                        break;
                }
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                if (!method) {
@@ -145,6 +146,7 @@ int validate_operative_mip_version_in_array(GPtrArray *descriptors,
                        range_set->ranges->len > 0,
                        "User method returned `BT_FUNC_STATUS_OK` without "
                        "adding a range to the supported MIP version range set.");
+               BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(method_status);
                if (method_status < 0) {
                        BT_LIB_LOGW_APPEND_CAUSE(
                                "Component class's \"get supported MIP versions\" method failed: "
@@ -193,6 +195,7 @@ bt_get_greatest_operative_mip_version(
 {
        int status = BT_FUNC_STATUS_OK;
 
+       BT_ASSERT_PRE_NO_ERROR();
        BT_ASSERT_PRE_NON_NULL(comp_descr_set, "Component descriptor set");
        BT_ASSERT_PRE_NON_NULL(operative_mip_version,
                "Operative MIP version (output)");
This page took 0.023265 seconds and 4 git commands to generate.