X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Flib%2Ftest_plugin.c;h=4306834c7417324db8a48d596523d0b34a826245;hb=05e2128659970c32648a01255ed870449f05d518;hp=bd59512b9707d06b7e86aa47ef6d1bb048d5e475;hpb=d94d92ac6656fd252a5d7bb4f6c76935ba18e62e;p=babeltrace.git diff --git a/tests/lib/test_plugin.c b/tests/lib/test_plugin.c index bd59512b..4306834c 100644 --- a/tests/lib/test_plugin.c +++ b/tests/lib/test_plugin.c @@ -118,10 +118,10 @@ static void test_sfs(const char *plugin_dir) char *sfs_path = get_test_plugin_path(plugin_dir, "sfs"); unsigned int major, minor, patch; const char *extra; - struct bt_private_value *params; - struct bt_value *results; - struct bt_value *object; - struct bt_value *res_params; + struct bt_value *params; + const struct bt_value *results; + const struct bt_value *object; + const struct bt_value *res_params; struct bt_private_graph *graph; const char *object_str; enum bt_graph_status graph_ret; @@ -164,7 +164,7 @@ static void test_sfs(const char *plugin_dir) ok(sink_comp_class, "bt_plugin_borrow_sink_component_class_by_name() finds a sink component class"); ok(strcmp(bt_component_class_get_help( - bt_component_class_sink_borrow_component_class(sink_comp_class)), + bt_component_class_sink_as_component_class(sink_comp_class)), "Bacon ipsum dolor amet strip steak cupim pastrami venison shoulder.\n" "Prosciutto beef ribs flank meatloaf pancetta brisket kielbasa drumstick\n" "venison tenderloin cow tail. Beef short loin shoulder meatball, sirloin\n" @@ -175,21 +175,20 @@ static void test_sfs(const char *plugin_dir) plugin, "filter"); ok(filter_comp_class, "bt_plugin_borrow_filter_component_class_by_name() finds a filter component class"); - params = bt_private_value_integer_create_init(23); + params = bt_value_integer_create_init(23); BT_ASSERT(params); ret = bt_private_query_executor_query(query_exec, - bt_component_class_filter_borrow_component_class(filter_comp_class), - "get-something", bt_private_value_borrow_value(params), - &results); + bt_component_class_filter_as_component_class(filter_comp_class), + "get-something", params, &results); ok(ret == 0 && results, "bt_private_query_executor_query() succeeds"); BT_ASSERT(bt_value_is_array(results) && bt_value_array_get_size(results) == 2); - object = bt_value_array_borrow_element_by_index(results, 0); + object = bt_value_array_borrow_element_by_index_const(results, 0); BT_ASSERT(object && bt_value_is_string(object)); object_str = bt_value_string_get(object); ok(strcmp(object_str, "get-something") == 0, "bt_component_class_query() receives the expected object name"); - res_params = bt_value_array_borrow_element_by_index(results, 1); - ok(res_params == bt_private_value_borrow_value(params), + res_params = bt_value_array_borrow_element_by_index_const(results, 1); + ok(bt_value_compare(res_params, params), "bt_component_class_query() receives the expected parameters"); bt_object_get_ref(sink_comp_class);