#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/graph/private-port.h>
#include <babeltrace/plugin/plugin.h>
-#include <babeltrace/ref.h>
+#include <babeltrace/object.h>
#include <glib.h>
#include "tap/tap.h"
fprintf(stderr, ":: stream 2, packet 2: %p\n", src_stream2_packet2);
}
- bt_put(trace);
+ bt_object_put_ref(trace);
}
static
g_array_free(test_events, TRUE);
/* Metadata */
- bt_put(src_stream_class);
- bt_put(src_event_class);
- bt_put(src_stream1);
- bt_put(src_stream2);
- bt_put(src_stream1_packet1);
- bt_put(src_stream1_packet2);
- bt_put(src_stream2_packet1);
- bt_put(src_stream2_packet2);
+ bt_object_put_ref(src_stream_class);
+ bt_object_put_ref(src_event_class);
+ bt_object_put_ref(src_stream1);
+ bt_object_put_ref(src_stream2);
+ bt_object_put_ref(src_stream1_packet1);
+ bt_object_put_ref(src_stream1_packet2);
+ bt_object_put_ref(src_stream2_packet1);
+ bt_object_put_ref(src_stream2_packet2);
}
static
for (i = 0; i < count; i++) {
append_test_events_from_notification(notifications[i]);
- bt_put(notifications[i]);
+ bt_object_put_ref(notifications[i]);
}
end:
switch (it_ret) {
case BT_NOTIFICATION_ITERATOR_STATUS_END:
ret = BT_COMPONENT_STATUS_END;
- BT_PUT(user_data->notif_iter);
+ BT_OBJECT_PUT_REF_AND_RESET(user_data->notif_iter);
goto end;
case BT_NOTIFICATION_ITERATOR_STATUS_AGAIN:
abort();
conn_status = bt_private_connection_create_notification_iterator(
priv_conn, &user_data->notif_iter);
BT_ASSERT(conn_status == 0);
- bt_put(priv_conn);
+ bt_object_put_ref(priv_conn);
return BT_COMPONENT_STATUS_OK;
}
private_component);
if (user_data) {
- bt_put(user_data->notif_iter);
+ bt_object_put_ref(user_data->notif_iter);
g_free(user_data);
}
}
ret = bt_graph_add_component(graph, src_comp_class, "source",
NULL, source);
BT_ASSERT(ret == 0);
- bt_put(src_comp_class);
+ bt_object_put_ref(src_comp_class);
}
/* Create sink component */
ret = bt_graph_add_component(graph, sink_comp_class, "sink",
NULL, sink);
BT_ASSERT(ret == 0);
- bt_put(sink_comp_class);
+ bt_object_put_ref(sink_comp_class);
}
}
BT_ASSERT(downstream_port);
graph_status = bt_graph_connect_ports(graph, upstream_port,
downstream_port, NULL);
- bt_put(upstream_port);
- bt_put(downstream_port);
+ bt_object_put_ref(upstream_port);
+ bt_object_put_ref(downstream_port);
/* Run the graph until the end */
while (graph_status == BT_GRAPH_STATUS_OK ||
"the produced sequence of test events is the expected one");
}
- bt_put(src_comp);
- bt_put(sink_comp);
- BT_PUT(graph);
+ bt_object_put_ref(src_comp);
+ bt_object_put_ref(sink_comp);
+ BT_OBJECT_PUT_REF_AND_RESET(graph);
}
static
notif_iter = bt_output_port_notification_iterator_create(upstream_port,
NULL);
ok(notif_iter, "bt_output_port_notification_iterator_create() succeeds");
- bt_put(upstream_port);
+ bt_object_put_ref(upstream_port);
/* Consume the notification iterator */
while (iter_status == BT_NOTIFICATION_ITERATOR_STATUS_OK) {
ok(compare_test_events(expected_test_events),
"the produced sequence of test events is the expected one");
- 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);
}
#define DEBUG_ENV_VAR "TEST_BT_NOTIFICATION_ITERATOR_DEBUG"