- BT_PUT(plugin);
- sink_component = bt_component_create(sink_comp_class, NULL, NULL);
- ok(sink_component, "bt_component_create() still works after the plugin object is destroyed");
- BT_PUT(sink_component);
- BT_PUT(source_comp_class);
- sink_component = bt_component_create(sink_comp_class, NULL, NULL);
- ok(sink_component, "bt_component_create() still works after the source component class object is destroyed");
- BT_PUT(sink_component);
- BT_PUT(filter_comp_class);
- sink_component = bt_component_create(sink_comp_class, NULL, NULL);
- ok(sink_component, "bt_component_create() still works after the filter component class object is destroyed");
- BT_PUT(sink_comp_class);
- BT_PUT(sink_component);
+ BT_OBJECT_PUT_REF_AND_RESET(plugin);
+ graph = bt_graph_create();
+ BT_ASSERT(graph);
+ graph_ret = bt_graph_add_component(graph, sink_comp_class, "the-sink",
+ NULL, &sink_component);
+ ok(graph_ret == BT_GRAPH_STATUS_OK && sink_component,
+ "bt_graph_add_component() still works after the plugin object is destroyed");
+ BT_OBJECT_PUT_REF_AND_RESET(sink_component);
+ BT_OBJECT_PUT_REF_AND_RESET(source_comp_class);
+ bt_object_put_ref(graph);
+ graph = bt_graph_create();
+ BT_ASSERT(graph);
+ graph_ret = bt_graph_add_component(graph, sink_comp_class, "the-sink",
+ NULL, &sink_component);
+ ok(graph_ret == BT_GRAPH_STATUS_OK && sink_component,
+ "bt_graph_add_component() still works after the source component class object is destroyed");
+ BT_OBJECT_PUT_REF_AND_RESET(sink_component);
+ BT_OBJECT_PUT_REF_AND_RESET(filter_comp_class);
+ bt_object_put_ref(graph);
+ graph = bt_graph_create();
+ BT_ASSERT(graph);
+ graph_ret = bt_graph_add_component(graph, sink_comp_class, "the-sink",
+ NULL, &sink_component);
+ ok(graph_ret == BT_GRAPH_STATUS_OK && sink_component,
+ "bt_graph_add_component() still works after the filter component class object is destroyed");
+ BT_OBJECT_PUT_REF_AND_RESET(sink_comp_class);
+ BT_OBJECT_PUT_REF_AND_RESET(sink_component);