tests: add libbabeltrace2 pre/postcondition testing infrastructure
[babeltrace.git] / tests / lib / test_remove_destruction_listener_in_destruction_listener.c
index 7bf4713365368fcdb8623cb6cde06072930ba8c8..a3827ddf03cf914430aff1c1fc9d8b11b9a2d4a1 100644 (file)
@@ -1,18 +1,7 @@
 /*
- * Copyright 2019 Efficios, Inc.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * 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.
- *
- * 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.
+ * Copyright (C) 2019 Efficios, Inc.
  */
 
 /*
@@ -240,18 +229,19 @@ bt_component_class_initialize_method_status hello_init(
 }
 
 static
-bt_component_class_message_iterator_next_method_status hello_iter_next(
+bt_message_iterator_class_next_method_status hello_iter_next(
                bt_self_message_iterator *message_iterator,
                bt_message_array_const msgs, uint64_t capacity,
                uint64_t *count)
 {
        BT_ASSERT(false);
-       return BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_OK;
+       return BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_OK;
 }
 
 int main(int argc, char **argv)
 {
        bt_graph *graph;
+       bt_message_iterator_class *msg_iter_cls;
        bt_component_class_source *source_cc;
        bt_component_class_set_method_status set_method_status;
        bt_graph_add_component_status add_component_status;
@@ -259,7 +249,10 @@ int main(int argc, char **argv)
 
        plan_tests(NR_TESTS);
 
-       source_cc = bt_component_class_source_create("Hello", hello_iter_next);
+       msg_iter_cls = bt_message_iterator_class_create(hello_iter_next);
+       BT_ASSERT(msg_iter_cls);
+
+       source_cc = bt_component_class_source_create("Hello", msg_iter_cls);
        BT_ASSERT(source_cc);
 
        set_method_status = bt_component_class_source_set_initialize_method(
@@ -274,8 +267,8 @@ int main(int argc, char **argv)
                BT_LOGGING_LEVEL_WARNING, &source);
        BT_ASSERT(add_component_status == BT_GRAPH_ADD_COMPONENT_STATUS_OK);
 
-       bt_component_source_put_ref(source);
        bt_component_class_source_put_ref(source_cc);
+       bt_message_iterator_class_put_ref(msg_iter_cls);
        bt_graph_put_ref(graph);
 
        return exit_status();
This page took 0.025309 seconds and 4 git commands to generate.