lib: use common precond. assert. macros from `assert-cond.h` thru lib
[babeltrace.git] / src / lib / graph / component-filter.c
index cfbb9640096cc94282853b95d5a95ea0b7a3a9b6..6582b8deaac79908ce15389577b25a8128bfaa95 100644 (file)
@@ -9,7 +9,7 @@
 #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>
@@ -51,7 +51,7 @@ bt_component_filter_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;
 
@@ -109,6 +109,7 @@ enum bt_self_component_add_port_status bt_self_component_filter_add_output_port(
        struct bt_port *port = NULL;
 
        BT_ASSERT_PRE_NO_ERROR();
+       BT_ASSERT_PRE_OUTPUT_PORT_NAME_UNIQUE(comp, name);
 
        /* bt_component_add_output_port() logs details and errors */
        status = bt_component_add_output_port(comp, name, user_data, &port);
@@ -178,6 +179,7 @@ enum bt_self_component_add_port_status bt_self_component_filter_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);
This page took 0.024186 seconds and 4 git commands to generate.