- bt_put(src_comp);
- BT_PUT(graph);
- bt_put(notif_iter);
-}
-
-static
-void test_output_port_notification_iterator_cannot_consume(void)
-{
- struct bt_component *src_comp;
- struct bt_notification_iterator *notif_iter;
- struct bt_port *upstream_port;
-
- clear_test_events();
- current_test = TEST_OUTPUT_PORT_NOTIFICATION_ITERATOR;
- diag("test: cannot consume graph with existing output port notification iterator");
- BT_ASSERT(!graph);
- graph = bt_graph_create();
- BT_ASSERT(graph);
- create_source_sink(graph, &src_comp, NULL);
-
- /* Create notification iterator on source's output port */
- upstream_port = bt_component_source_get_output_port_by_name(src_comp, "out");
- notif_iter = bt_output_port_notification_iterator_create(upstream_port,
- NULL);
- BT_ASSERT(notif_iter);
- bt_put(upstream_port);
-
- /*
- * This should fail because the graph is now managed by the
- * notification iterator.
- */
- ok(bt_graph_run(graph) == BT_GRAPH_STATUS_CANNOT_CONSUME,
- "bt_graph_run() returns BT_GRAPH_STATUS_CANNOT_CONSUME when there's an output port notification iterator");
-
- bt_put(src_comp);
- BT_PUT(graph);
- bt_put(notif_iter);
+ bt_object_put_ref(src_comp);
+ BT_OBJECT_PUT_REF_AND_RESET(graph);
+ bt_object_put_ref(notif_iter);