lib: rename bt_value_array_get_size() -> bt_value_array_get_length()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 14 Aug 2019 18:46:36 +0000 (14:46 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 15 Aug 2019 15:41:44 +0000 (11:41 -0400)
"Length" is in line with the field terminology
(bt_field_array_get_length()).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Icbb468c0f6d74cba2c5f2f25559981eedec33c5d
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1928
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
19 files changed:
include/babeltrace2/value-const.h
src/autodisc/autodisc.c
src/bindings/python/bt2/bt2/native_bt_autodisc.i.h
src/bindings/python/bt2/bt2/value.py
src/cli/babeltrace2-cfg-cli-args-connect.c
src/cli/babeltrace2-cfg-cli-args.c
src/cli/babeltrace2-plugins.c
src/cli/babeltrace2.c
src/ctf-writer/attributes.c
src/ctf-writer/values.c
src/ctf-writer/values.h
src/lib/lib-logging.c
src/lib/trace-ir/attributes.c
src/lib/value.c
src/plugins/ctf/fs-src/fs.c
src/plugins/ctf/lttng-live/viewer-connection.c
src/plugins/text/details/write.c
tests/lib/plugin.c
tests/lib/test_bt_values.c

index 67c05795cf126cca9f60554f744c37b46afb9c71..f9a1d3d093cad57badc49151f8a4fc083e889f4b 100644 (file)
@@ -133,12 +133,12 @@ extern double bt_value_real_get(const bt_value *real_obj);
 
 extern const char *bt_value_string_get(const bt_value *string_obj);
 
-extern uint64_t bt_value_array_get_size(const bt_value *array_obj);
+extern uint64_t bt_value_array_get_length(const bt_value *array_obj);
 
 static inline
 bt_bool bt_value_array_is_empty(const bt_value *array_obj)
 {
-       return bt_value_array_get_size(array_obj) == 0;
+       return bt_value_array_get_length(array_obj) == 0;
 }
 
 extern const bt_value *bt_value_array_borrow_element_by_index_const(
index 85b6bfc78c5097c30a64ffd9d090940876325f4a..211a930e877fe33d1cabb607cd7c63878f092f54 100644 (file)
@@ -131,7 +131,7 @@ end:
 static
 const bt_value *borrow_array_value_last_element_const(const bt_value *array)
 {
-       uint64_t last_index = bt_value_array_get_size(array) - 1;
+       uint64_t last_index = bt_value_array_get_length(array) - 1;
 
        return bt_value_array_borrow_element_by_index_const(array, last_index);
 }
@@ -720,7 +720,7 @@ int auto_discover_source_components(
        uint64_t i_inputs, input_count;
        int status;
 
-       input_count = bt_value_array_get_size(inputs);
+       input_count = bt_value_array_get_length(inputs);
 
        for (i_inputs = 0; i_inputs < input_count; i_inputs++) {
                const bt_value *input_value;
index e09f54e768b803f713e82380fb44c8a4395be3d1..eb386610841f4dfe5d570bafe9d2edea1d92386f 100644 (file)
@@ -62,7 +62,7 @@ bt_value *bt_bt2_auto_discover_source_components(const bt_value *inputs,
        bt_value_map_insert_entry_status insert_entry_status;
 
        BT_ASSERT(bt_value_get_type(inputs) == BT_VALUE_TYPE_ARRAY);
-       for (i = 0; i < bt_value_array_get_size(inputs); i++) {
+       for (i = 0; i < bt_value_array_get_length(inputs); i++) {
                const bt_value *elem = bt_value_array_borrow_element_by_index_const(inputs, i);
                BT_ASSERT(bt_value_get_type(elem) == BT_VALUE_TYPE_STRING);
        }
index 104698a0fb752eb9b9776a6c1c41e1c1aa2e6660..8c8ef60c3de1a74bca8af47eb72ba203f5428c21 100644 (file)
@@ -448,7 +448,7 @@ class ArrayValue(_Container, collections.abc.MutableSequence, _Value):
         return True
 
     def __len__(self):
-        size = native_bt.value_array_get_size(self._ptr)
+        size = native_bt.value_array_get_length(self._ptr)
         assert size >= 0
         return size
 
index 7f2ff92b065a0218967ccde6f525176cac26e629..b9693369903f94516a85309b4251c97d2f2e5d9d 100644 (file)
@@ -693,7 +693,7 @@ int bt_config_cli_args_create_connections(struct bt_config *cfg,
                goto error;
        }
 
-       for (i = 0; i < bt_value_array_get_size(connection_args); i++) {
+       for (i = 0; i < bt_value_array_get_length(connection_args); i++) {
                const bt_value *arg_value =
                        bt_value_array_borrow_element_by_index_const(
                                connection_args, i);
index 81dd05bbb1ae856db79e8e2243a77524833c904f..8fbe0a96913ad485b2b307ad1183c3b692cb6f8d 100644 (file)
@@ -798,7 +798,7 @@ int insert_flat_params_from_array(GString *params_arg,
                goto end;
        }
 
-       for (i = 0; i < bt_value_array_get_size(names_array); i++) {
+       for (i = 0; i < bt_value_array_get_length(names_array); i++) {
                const bt_value *str_obj =
                        bt_value_array_borrow_element_by_index_const(names_array,
                                                                     i);
@@ -2271,7 +2271,7 @@ struct bt_config *bt_config_run_from_args_array(const bt_value *run_args,
        struct bt_config *cfg = NULL;
        const char **argv;
        int64_t i, len;
-       const size_t argc = bt_value_array_get_size(run_args);
+       const size_t argc = bt_value_array_get_length(run_args);
 
        argv = calloc(argc, sizeof(*argv));
        if (!argv) {
@@ -2279,7 +2279,7 @@ struct bt_config *bt_config_run_from_args_array(const bt_value *run_args,
                goto end;
        }
 
-       len = bt_value_array_get_size(run_args);
+       len = bt_value_array_get_length(run_args);
        if (len < 0) {
                BT_CLI_LOGE_APPEND_CAUSE("Invalid executable arguments.");
                goto end;
@@ -2606,7 +2606,7 @@ int append_run_args_for_implicit_component(
                }
        }
 
-       for (i = 0; i < bt_value_array_get_size(impl_args->extra_params);
+       for (i = 0; i < bt_value_array_get_length(impl_args->extra_params);
                        i++) {
                const bt_value *elem;
                const char *arg;
@@ -2814,7 +2814,7 @@ int bt_value_to_cli_param_value_append(const bt_value *value, GString *buf)
        }
        case BT_VALUE_TYPE_ARRAY: {
                g_string_append_c(buf, '[');
-               uint64_t sz = bt_value_array_get_size(value);
+               uint64_t sz = bt_value_array_get_length(value);
                for (uint64_t i = 0; i < sz; i++) {
                        const bt_value *item;
                        int ret;
@@ -3228,7 +3228,7 @@ int create_implicit_component_args_from_auto_discovered_sources(
                 * non-option arguments that contributed to this
                 * component instance coming into existence.
                 */
-               orig_indices_count = bt_value_array_get_size(res->original_input_indices);
+               orig_indices_count = bt_value_array_get_length(res->original_input_indices);
                for (orig_indices_i = 0; orig_indices_i < orig_indices_count; orig_indices_i++) {
                        const bt_value *orig_idx_value =
                                bt_value_array_borrow_element_by_index(
@@ -3240,7 +3240,7 @@ int create_implicit_component_args_from_auto_discovered_sources(
                        uint64_t params_i, params_count;
                        const bt_value *loglevel_value;
 
-                       params_count = bt_value_array_get_size(params_array);
+                       params_count = bt_value_array_get_length(params_array);
                        for (params_i = 0; params_i < params_count; params_i++) {
                                const bt_value *params_value =
                                        bt_value_array_borrow_element_by_index_const(
@@ -3653,7 +3653,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                                         * it in `non_opt_params`.
                                         */
                                        bt_value *array;
-                                       uint64_t idx = bt_value_array_get_size(non_opt_params) - 1;
+                                       uint64_t idx = bt_value_array_get_length(non_opt_params) - 1;
 
                                        array = bt_value_array_borrow_element_by_index(non_opt_params, idx);
                                        bt_value_array_append_string_element(array, arg);
@@ -3676,7 +3676,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                                                goto error;
                                        }
                                } else if (current_item_type == CONVERT_CURRENT_ITEM_TYPE_NON_OPT) {
-                                       uint64_t idx = bt_value_array_get_size(non_opt_loglevels) - 1;
+                                       uint64_t idx = bt_value_array_get_length(non_opt_loglevels) - 1;
                                        bt_value *log_level_str_value;
 
                                        log_level_str_value = bt_value_string_create_init(arg);
@@ -4136,7 +4136,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                        goto error;
                }
 
-               if (bt_value_array_get_size(non_opts) > 1) {
+               if (bt_value_array_get_length(non_opts) > 1) {
                        BT_CLI_LOGE_APPEND_CAUSE("Too many paths specified for --output-format=ctf-metadata.");
                        goto error;
                }
@@ -4214,11 +4214,11 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
        }
 
        /* Decide where the non-option argument(s) go */
-       if (bt_value_array_get_size(non_opts) > 0) {
+       if (bt_value_array_get_length(non_opts) > 0) {
                if (implicit_lttng_live_args.exists) {
                        const bt_value *bt_val_non_opt;
 
-                       if (bt_value_array_get_size(non_opts) > 1) {
+                       if (bt_value_array_get_length(non_opts) > 1) {
                                BT_CLI_LOGE_APPEND_CAUSE("Too many URLs specified for --input-format=lttng-live.");
                                goto error;
                        }
@@ -4520,7 +4520,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                        goto error;
                }
 
-               for (i = 0; i < bt_value_array_get_size(run_args); i++) {
+               for (i = 0; i < bt_value_array_get_length(run_args); i++) {
                        const bt_value *arg_value =
                                bt_value_array_borrow_element_by_index(run_args,
                                                                       i);
@@ -4548,7 +4548,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                                g_string_free(quoted, TRUE);
                        }
 
-                       if (i < bt_value_array_get_size(run_args) - 1) {
+                       if (i < bt_value_array_get_length(run_args) - 1) {
                                if (print_run_args) {
                                        putchar(' ');
                                } else {
index 6be4e154832e41bb36fefc4ba8b99d066cc476f8..1defc30668dea965404ff83709621a3e92f9a4c6 100644 (file)
@@ -128,7 +128,7 @@ int load_dynamic_plugins(const bt_value *plugin_paths)
 {
        int nr_paths, i, ret = 0;
 
-       nr_paths = bt_value_array_get_size(plugin_paths);
+       nr_paths = bt_value_array_get_length(plugin_paths);
        if (nr_paths < 0) {
                BT_CLI_LOGE_APPEND_CAUSE(
                        "Cannot load dynamic plugins: no plugin path.");
index 49b6b9bdb2e3e3d11de46bdaf618eac0a494a2fc..11f63494bc074c6cdc8b858c97c06987652e6a12 100644 (file)
@@ -375,7 +375,7 @@ void print_value_rec(FILE *fp, const bt_value *value, size_t indent)
                        bt_common_color_reset());
                break;
        case BT_VALUE_TYPE_ARRAY:
-               size = bt_value_array_get_size(value);
+               size = bt_value_array_get_length(value);
                if (size < 0) {
                        goto error;
                }
@@ -966,7 +966,7 @@ int cmd_print_lttng_live_sessions(struct bt_config *cfg)
                }
        }
 
-       array_size = bt_value_array_get_size(results);
+       array_size = bt_value_array_get_length(results);
        for (i = 0; i < array_size; i++) {
                const char *url_text;
                int64_t timer_us, streams, clients;
@@ -1974,7 +1974,7 @@ int set_stream_intersections(struct cmd_run_ctx *ctx,
                goto error;
        }
 
-       trace_count = bt_value_array_get_size(query_result);
+       trace_count = bt_value_array_get_length(query_result);
        if (trace_count < 0) {
                ret = -1;
                goto error;
@@ -2038,7 +2038,7 @@ int set_stream_intersections(struct cmd_run_ctx *ctx,
                        goto error;
                }
 
-               stream_count = bt_value_array_get_size(stream_infos);
+               stream_count = bt_value_array_get_length(stream_infos);
                if (stream_count < 0) {
                        ret = -1;
                        goto error;
index ba4711293132ce38bef407a0ebff847bbe57dc60..78d892b2b167168e164f2c4d3fb3fc39835762f7 100644 (file)
@@ -80,7 +80,7 @@ void bt_ctf_attributes_destroy(struct bt_ctf_private_value *attr_obj)
 BT_HIDDEN
 int64_t bt_ctf_attributes_get_count(struct bt_ctf_private_value *attr_obj)
 {
-       return bt_ctf_value_array_get_size(bt_ctf_private_value_as_value(attr_obj));
+       return bt_ctf_value_array_get_length(bt_ctf_private_value_as_value(attr_obj));
 }
 
 BT_HIDDEN
@@ -96,10 +96,10 @@ const char *bt_ctf_attributes_get_field_name(struct bt_ctf_private_value *attr_o
                goto end;
        }
 
-       if (index >= bt_ctf_value_array_get_size(bt_ctf_private_value_as_value(attr_obj))) {
+       if (index >= bt_ctf_value_array_get_length(bt_ctf_private_value_as_value(attr_obj))) {
                BT_LOGW("Invalid parameter: index is out of bounds: "
                        "index=%" PRIu64 ", count=%" PRId64,
-                       index, bt_ctf_value_array_get_size(bt_ctf_private_value_as_value(attr_obj)));
+                       index, bt_ctf_value_array_get_length(bt_ctf_private_value_as_value(attr_obj)));
                goto end;
        }
 
@@ -140,10 +140,10 @@ struct bt_ctf_private_value *bt_ctf_attributes_borrow_field_value(struct bt_ctf_
                goto end;
        }
 
-       if (index >= bt_ctf_value_array_get_size(bt_ctf_private_value_as_value(attr_obj))) {
+       if (index >= bt_ctf_value_array_get_length(bt_ctf_private_value_as_value(attr_obj))) {
                BT_LOGW("Invalid parameter: index is out of bounds: "
                        "index=%" PRIu64 ", count=%" PRId64,
-                       index, bt_ctf_value_array_get_size(bt_ctf_private_value_as_value(attr_obj)));
+                       index, bt_ctf_value_array_get_length(bt_ctf_private_value_as_value(attr_obj)));
                goto end;
        }
 
@@ -176,7 +176,7 @@ struct bt_ctf_private_value *bt_ctf_attributes_borrow_field_by_name(
        struct bt_ctf_private_value *value_obj = NULL;
        struct bt_ctf_private_value *attr_field_name_obj = NULL;
 
-       attr_size = bt_ctf_value_array_get_size(bt_ctf_private_value_as_value(attr_obj));
+       attr_size = bt_ctf_value_array_get_length(bt_ctf_private_value_as_value(attr_obj));
        if (attr_size < 0) {
                BT_LOGE("Cannot get array value's size: value-addr=%p",
                        attr_obj);
@@ -318,7 +318,7 @@ int bt_ctf_attributes_freeze(struct bt_ctf_private_value *attr_obj)
        }
 
        BT_LOGD("Freezing attributes object: value-addr=%p", attr_obj);
-       count = bt_ctf_value_array_get_size(bt_ctf_private_value_as_value(attr_obj));
+       count = bt_ctf_value_array_get_length(bt_ctf_private_value_as_value(attr_obj));
        BT_ASSERT(count >= 0);
 
        /*
index f7f5a72e52e225978ef643f81db930c0cdf6a565..91fcbdd20c3cd7b31a2bde4ac0ad2217aa7c38ea 100644 (file)
@@ -400,14 +400,14 @@ bt_ctf_bool bt_ctf_value_array_compare(const struct bt_ctf_value *object_a,
        const struct bt_ctf_value_array *array_obj_a =
                BT_CTF_VALUE_TO_ARRAY(object_a);
 
-       if (bt_ctf_value_array_get_size(object_a) !=
-                       bt_ctf_value_array_get_size(object_b)) {
+       if (bt_ctf_value_array_get_length(object_a) !=
+                       bt_ctf_value_array_get_length(object_b)) {
                BT_LOGT("Array values are different: size mismatch "
                        "value-a-addr=%p, value-b-addr=%p, "
                        "value-a-size=%" PRId64 ", value-b-size=%" PRId64,
                        object_a, object_b,
-                       bt_ctf_value_array_get_size(object_a),
-                       bt_ctf_value_array_get_size(object_b));
+                       bt_ctf_value_array_get_length(object_a),
+                       bt_ctf_value_array_get_length(object_b));
                ret = BT_CTF_FALSE;
                goto end;
        }
@@ -854,7 +854,7 @@ enum bt_ctf_value_status bt_ctf_private_value_string_set(
 }
 
 BT_HIDDEN
-uint64_t bt_ctf_value_array_get_size(const struct bt_ctf_value *array_obj)
+uint64_t bt_ctf_value_array_get_length(const struct bt_ctf_value *array_obj)
 {
        BT_CTF_ASSERT_PRE_NON_NULL(array_obj, "Value object");
        BT_CTF_ASSERT_PRE_VALUE_IS_TYPE(array_obj, BT_CTF_VALUE_TYPE_ARRAY);
index dc237c5b5c54f0c8ba249ab49e2a248a20458341..5c8485b5763bbdc4ec94d3efee35d7c624ef66a4 100644 (file)
@@ -145,12 +145,12 @@ BT_HIDDEN
 const char *bt_ctf_value_string_get(const struct bt_ctf_value *string_obj);
 
 BT_HIDDEN
-uint64_t bt_ctf_value_array_get_size(const struct bt_ctf_value *array_obj);
+uint64_t bt_ctf_value_array_get_length(const struct bt_ctf_value *array_obj);
 
 static inline
 bt_ctf_bool bt_ctf_value_array_is_empty(const struct bt_ctf_value *array_obj)
 {
-       return bt_ctf_value_array_get_size(array_obj) == 0;
+       return bt_ctf_value_array_get_length(array_obj) == 0;
 }
 
 BT_HIDDEN
index ce69b30ddefb301353f5ed5d4629a01a46456517..461a67d9e25c6e42505703c8269bac4039d28e9e 100644 (file)
@@ -905,7 +905,7 @@ static inline void format_value(char **buf_ch, bool extended,
        }
        case BT_VALUE_TYPE_ARRAY:
        {
-               int64_t count = bt_value_array_get_size(value);
+               int64_t count = bt_value_array_get_length(value);
 
                BT_ASSERT(count >= 0);
                BUF_APPEND(", %selement-count=%" PRId64, PRFIELD(count));
index 488dd86feab50bb4449d400797c7c255ef9d5555..f228569b92dc41e8ad4bdee633da837a2bb539c8 100644 (file)
@@ -79,7 +79,7 @@ void bt_attributes_destroy(struct bt_value *attr_obj)
 BT_HIDDEN
 int64_t bt_attributes_get_count(const struct bt_value *attr_obj)
 {
-       return bt_value_array_get_size(attr_obj);
+       return bt_value_array_get_length(attr_obj);
 }
 
 BT_HIDDEN
@@ -91,7 +91,7 @@ const char *bt_attributes_get_field_name(const struct bt_value *attr_obj,
        const struct bt_value *attr_field_name_obj = NULL;
 
        BT_ASSERT(attr_obj);
-       BT_ASSERT(index < bt_value_array_get_size(attr_obj));
+       BT_ASSERT(index < bt_value_array_get_length(attr_obj));
        attr_field_obj = bt_value_array_borrow_element_by_index_const(
                attr_obj, index);
        if (!attr_field_obj) {
@@ -126,7 +126,7 @@ struct bt_value *bt_attributes_borrow_field_value(
        struct bt_value *attr_field_obj = NULL;
 
        BT_ASSERT(attr_obj);
-       BT_ASSERT(index < bt_value_array_get_size(attr_obj));
+       BT_ASSERT(index < bt_value_array_get_length(attr_obj));
        attr_field_obj =
                bt_value_array_borrow_element_by_index(attr_obj, index);
        if (!attr_field_obj) {
@@ -158,7 +158,7 @@ struct bt_value *bt_attributes_borrow_field_by_name(
        struct bt_value *value_obj = NULL;
        struct bt_value *attr_field_name_obj = NULL;
 
-       attr_size = bt_value_array_get_size(attr_obj);
+       attr_size = bt_value_array_get_length(attr_obj);
        if (attr_size < 0) {
                BT_LIB_LOGE_APPEND_CAUSE(
                        "Cannot get array value's size: %![value-]+v",
@@ -294,7 +294,7 @@ int bt_attributes_freeze(const struct bt_value *attr_obj)
 
        BT_ASSERT(attr_obj);
        BT_LOGD("Freezing attributes object: value-addr=%p", attr_obj);
-       count = bt_value_array_get_size(attr_obj);
+       count = bt_value_array_get_length(attr_obj);
        BT_ASSERT(count >= 0);
 
        /*
index 8057663cb3e03fc878e16d600cb2f7ca50b62a2a..42c4bfd1dcd403d17cc429020bfb25f4815866af 100644 (file)
@@ -386,14 +386,14 @@ bt_bool bt_value_array_compare(const struct bt_value *object_a,
        const struct bt_value_array *array_obj_a =
                BT_VALUE_TO_ARRAY(object_a);
 
-       if (bt_value_array_get_size(object_a) !=
-                       bt_value_array_get_size(object_b)) {
+       if (bt_value_array_get_length(object_a) !=
+                       bt_value_array_get_length(object_b)) {
                BT_LOGT("Array values are different: size mismatch "
                        "value-a-addr=%p, value-b-addr=%p, "
                        "value-a-size=%" PRId64 ", value-b-size=%" PRId64,
                        object_a, object_b,
-                       bt_value_array_get_size(object_a),
-                       bt_value_array_get_size(object_b));
+                       bt_value_array_get_length(object_a),
+                       bt_value_array_get_length(object_b));
                ret = BT_FALSE;
                goto end;
        }
@@ -879,7 +879,7 @@ enum bt_value_string_set_status bt_value_string_set(
        return BT_FUNC_STATUS_OK;
 }
 
-uint64_t bt_value_array_get_size(const struct bt_value *array_obj)
+uint64_t bt_value_array_get_length(const struct bt_value *array_obj)
 {
        BT_ASSERT_PRE_DEV_NON_NULL(array_obj, "Value object");
        BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
index 0f437ddea9c14cf31159f216dc41b3246df8cccd..38878f18e2829a5c202b8fc2c1a2a3589ed55883 100644 (file)
@@ -1703,7 +1703,7 @@ int ctf_fs_component_create_ctf_fs_traces(bt_self_component_source *self_comp,
        int ret = 0;
        uint64_t i;
 
-       for (i = 0; i < bt_value_array_get_size(paths_value); i++) {
+       for (i = 0; i < bt_value_array_get_length(paths_value); i++) {
                const bt_value *path_value = bt_value_array_borrow_element_by_index_const(paths_value, i);
                const char *input = bt_value_string_get(path_value);
 
@@ -1847,7 +1847,7 @@ bool validate_inputs_parameter(struct ctf_fs_component *ctf_fs,
                goto error;
        }
 
-       for (i = 0; i < bt_value_array_get_size(inputs); i++) {
+       for (i = 0; i < bt_value_array_get_length(inputs); i++) {
                const bt_value *elem;
 
                elem = bt_value_array_borrow_element_by_index_const(inputs, i);
index d96a225601ea3a2bc5eccb16a369a64cd5bdd8ad..bc03be54de33b7ed8daf10289a2adaa12834b492 100644 (file)
@@ -316,7 +316,7 @@ int list_update_session(bt_value *results,
        int i, len;
        bool found = false;
 
-       len = bt_value_array_get_size(results);
+       len = bt_value_array_get_length(results);
        if (len < 0) {
                BT_COMP_LOGE_STR("Error getting size of array.");
                ret = -1;
index 7c05d1458013581502ad020fdbe2210c9220ac9a..78ab04dcc5dc613854146947a7dbbf4afae552aa 100644 (file)
@@ -424,7 +424,7 @@ void write_value(struct details_write_ctx *ctx, const bt_value *value,
                break;
        case BT_VALUE_TYPE_ARRAY:
        {
-               uint64_t length = bt_value_array_get_size(value);
+               uint64_t length = bt_value_array_get_length(value);
 
                if (length == 0) {
                        write_sp(ctx);
index a5bbe0c761613a3c2ab7901c23dbe0ea039b7b20..ff287c1c100a945bf14b7dc8cf9898b1cfab7349 100644 (file)
@@ -186,7 +186,7 @@ static void test_sfs(const char *plugin_dir)
        BT_ASSERT(query_exec);
        ret = bt_query_executor_query(query_exec, &results);
        ok(ret == 0 && results, "bt_query_executor_query() succeeds");
-       BT_ASSERT(bt_value_is_array(results) && bt_value_array_get_size(results) == 2);
+       BT_ASSERT(bt_value_is_array(results) && bt_value_array_get_length(results) == 2);
        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);
index 39427f46e4b568fb2d03200a5c5dc672300e88bd..c1700f7908bb7774a3fddcb41ce663e86bd0300c 100644 (file)
@@ -230,7 +230,7 @@ void test_array(void)
        ret |= bt_value_array_append_element(array_obj,
                bt_value_null);
        ok(!ret, "bt_value_array_append_element() succeeds");
-       ok(bt_value_array_get_size(array_obj) == 5,
+       ok(bt_value_array_get_length(array_obj) == 5,
                "appending an element to an array value object increment its size");
 
        obj = bt_value_array_borrow_element_by_index(array_obj, 0);
@@ -294,7 +294,7 @@ void test_array(void)
        ret = bt_value_array_append_empty_map_element(array_obj);
        ok(!ret, "bt_value_array_append_empty_map_element() succeeds");
 
-       ok(bt_value_array_get_size(array_obj) == 12,
+       ok(bt_value_array_get_length(array_obj) == 12,
                "the bt_value_array_append_element_*() functions increment the array value object's size");
        ok(!bt_value_array_is_empty(array_obj),
                "map value object is not empty");
@@ -847,9 +847,9 @@ void test_compare_array(void)
        BT_ASSERT(append_status == BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK);
        append_status = bt_value_array_append_bool_element(array3, BT_FALSE);
        BT_ASSERT(append_status == BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK);
-       BT_ASSERT(bt_value_array_get_size(array1) == 3);
-       BT_ASSERT(bt_value_array_get_size(array2) == 3);
-       BT_ASSERT(bt_value_array_get_size(array3) == 3);
+       BT_ASSERT(bt_value_array_get_length(array1) == 3);
+       BT_ASSERT(bt_value_array_get_length(array2) == 3);
+       BT_ASSERT(bt_value_array_get_length(array3) == 3);
 
        ok(!bt_value_compare(bt_value_null,
                array1),
This page took 0.042429 seconds and 4 git commands to generate.