X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=tests%2Flib%2Ftest_trace_ir_ref.c;h=d5dfa9cf94afd3289403154710ac3cdfa3e0b2ad;hp=7eeef185a76b2261eab639ffce4cd806e074334b;hb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;hpb=9c08c816a55bbc538957648b49d41354e43c7cdf diff --git a/tests/lib/test_trace_ir_ref.c b/tests/lib/test_trace_ir_ref.c index 7eeef185..d5dfa9cf 100644 --- a/tests/lib/test_trace_ir_ref.c +++ b/tests/lib/test_trace_ir_ref.c @@ -1,22 +1,9 @@ /* - * test_trace_ir_ref.c + * SPDX-License-Identifier: GPL-2.0-only * - * Trace IR Reference Count test - * - * Copyright 2016 - Jérémie Galarneau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; under version 2 of the License. + * Copyright (C) 2016 Jérémie Galarneau * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Trace IR Reference Count test */ #include @@ -409,39 +396,45 @@ static void test_example_scenario(bt_self_component_source *self_comp) } static -bt_component_class_init_method_status src_init( +bt_component_class_initialize_method_status src_init( bt_self_component_source *self_comp, + bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data) { test_example_scenario(self_comp); - return BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK; + return BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK; } static -bt_component_class_message_iterator_next_method_status src_iter_next( +bt_message_iterator_class_next_method_status src_iter_next( bt_self_message_iterator *self_iterator, bt_message_array_const msgs, uint64_t capacity, uint64_t *count) { - return BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_ERROR; + return BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_ERROR; } static void test_example_scenario_in_graph(void) { + bt_message_iterator_class *msg_iter_cls; bt_component_class_source *comp_cls; bt_graph *graph; int ret; - comp_cls = bt_component_class_source_create("src", src_iter_next); + msg_iter_cls = bt_message_iterator_class_create(src_iter_next); + BT_ASSERT(msg_iter_cls); + + comp_cls = bt_component_class_source_create("src", msg_iter_cls); BT_ASSERT(comp_cls); - ret = bt_component_class_source_set_init_method(comp_cls, src_init); + ret = bt_component_class_source_set_initialize_method(comp_cls, src_init); BT_ASSERT(ret == 0); - graph = bt_graph_create(); + graph = bt_graph_create(0); ret = bt_graph_add_source_component(graph, comp_cls, "src-comp", NULL, BT_LOGGING_LEVEL_NONE, NULL); BT_ASSERT(ret == 0); bt_graph_put_ref(graph); bt_component_class_source_put_ref(comp_cls); + bt_message_iterator_class_put_ref(msg_iter_cls); } static void create_writer_user_full(struct writer_user *user)