lib: use common precond. assert. macros from `assert-cond.h` thru lib
[babeltrace.git] / src / lib / graph / component-sink.c
index f3093b2ac3f3ffbdf63ee4cf7bf2c537ae8ba422..d9d33cc9ab205c6a5de9e7722c10f25e1c8e7e16 100644 (file)
@@ -9,8 +9,7 @@
 #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>
@@ -52,7 +51,7 @@ bt_component_sink_borrow_class_const(
 {
        struct bt_component_class *cls;
 
-       BT_ASSERT_PRE_DEV_NON_NULL(component, "Component");
+       BT_ASSERT_PRE_DEV_COMP_NON_NULL(component);
 
        cls = component->parent.class;
 
@@ -113,6 +112,7 @@ enum bt_self_component_add_port_status bt_self_component_sink_add_input_port(
        struct bt_component *comp = (void *) self_comp;
 
        BT_ASSERT_PRE_NO_ERROR();
+       BT_ASSERT_PRE_INPUT_PORT_NAME_UNIQUE(comp, name);
 
        /* bt_component_add_input_port() logs details/errors */
        status = bt_component_add_input_port(comp, name, user_data, &port);
@@ -135,7 +135,7 @@ bt_bool bt_self_component_sink_is_interrupted(
 {
        struct bt_component *comp = (void *) self_comp;
 
-       BT_ASSERT_PRE_NON_NULL(comp, "Component");
+       BT_ASSERT_PRE_COMP_NON_NULL(comp);
        return (bt_bool) bt_graph_is_interrupted(
                bt_component_borrow_graph(comp));
 }
This page took 0.02444 seconds and 4 git commands to generate.