- struct bt_private_value *null_copy_obj;
- struct bt_private_value *bool_obj, *bool_copy_obj;
- struct bt_private_value *integer_obj, *integer_copy_obj;
- struct bt_private_value *real_obj, *real_copy_obj;
- struct bt_private_value *string_obj, *string_copy_obj;
- struct bt_private_value *array_obj, *array_copy_obj;
- struct bt_private_value *map_obj, *map_copy_obj;
- enum bt_value_status status;
-
- bool_obj = bt_private_value_bool_create_init(BT_TRUE);
- integer_obj = bt_private_value_integer_create_init(23);
- real_obj = bt_private_value_real_create_init(-3.1416);
- string_obj = bt_private_value_string_create_init("test");
- array_obj = bt_private_value_array_create();
- map_obj = bt_private_value_map_create();
-
- BT_ASSERT(bool_obj && integer_obj && real_obj && string_obj &&
- array_obj && map_obj);
-
- status = bt_private_value_array_append_element(array_obj,
- bt_private_value_as_value(bool_obj));
- BT_ASSERT(status == BT_VALUE_STATUS_OK);
- status = bt_private_value_array_append_element(array_obj,
- bt_private_value_as_value(integer_obj));
- BT_ASSERT(status == BT_VALUE_STATUS_OK);
- status = bt_private_value_array_append_element(array_obj,
- bt_private_value_as_value(real_obj));
- BT_ASSERT(status == BT_VALUE_STATUS_OK);
- status = bt_private_value_array_append_element(array_obj,
- bt_value_null);
- BT_ASSERT(status == BT_VALUE_STATUS_OK);
- status = bt_private_value_map_insert_entry(map_obj, "array",
- bt_private_value_as_value(array_obj));
- BT_ASSERT(status == BT_VALUE_STATUS_OK);
- status = bt_private_value_map_insert_entry(map_obj, "string",
- bt_private_value_as_value(string_obj));
- BT_ASSERT(status == BT_VALUE_STATUS_OK);
-
- status = bt_value_copy(&map_copy_obj,
- bt_private_value_as_value(map_obj));
- ok(status == BT_VALUE_STATUS_OK && map_copy_obj,
+ bt_value *null_copy_obj;
+ bt_value *bool_obj, *bool_copy_obj;
+ bt_value *unsigned_integer_obj, *unsigned_integer_copy_obj;
+ bt_value *signed_integer_obj, *signed_integer_copy_obj;
+ bt_value *real_obj, *real_copy_obj;
+ bt_value *string_obj, *string_copy_obj;
+ bt_value *array_obj, *array_copy_obj;
+ bt_value *map_obj, *map_copy_obj;
+ bt_value_array_append_element_status append_status;
+ bt_value_map_insert_entry_status insert_status;
+ bt_value_copy_status copy_status;
+
+ bool_obj = bt_value_bool_create_init(BT_TRUE);
+ unsigned_integer_obj = bt_value_integer_unsigned_create_init(23);
+ signed_integer_obj = bt_value_integer_signed_create_init(-47);
+ real_obj = bt_value_real_create_init(-3.1416);
+ string_obj = bt_value_string_create_init("test");
+ array_obj = bt_value_array_create();
+ map_obj = bt_value_map_create();
+
+ BT_ASSERT(bool_obj && unsigned_integer_obj && signed_integer_obj &&
+ real_obj && string_obj && array_obj && map_obj);
+
+ append_status = bt_value_array_append_element(array_obj, bool_obj);
+ BT_ASSERT(append_status == BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK);
+ append_status = bt_value_array_append_element(array_obj, unsigned_integer_obj);
+ BT_ASSERT(append_status == BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK);
+ append_status = bt_value_array_append_element(array_obj, signed_integer_obj);
+ BT_ASSERT(append_status == BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK);
+ append_status = bt_value_array_append_element(array_obj, real_obj);
+ BT_ASSERT(append_status == BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK);
+ append_status = bt_value_array_append_element(array_obj, bt_value_null);
+ BT_ASSERT(append_status == BT_VALUE_ARRAY_APPEND_ELEMENT_STATUS_OK);
+ insert_status = bt_value_map_insert_entry(map_obj, "array", array_obj);
+ BT_ASSERT(insert_status == BT_VALUE_MAP_INSERT_ENTRY_STATUS_OK);
+ insert_status = bt_value_map_insert_entry(map_obj, "string", string_obj);
+ BT_ASSERT(insert_status == BT_VALUE_MAP_INSERT_ENTRY_STATUS_OK);
+
+ copy_status = bt_value_copy(map_obj, &map_copy_obj);
+ ok(copy_status == BT_VALUE_COPY_STATUS_OK && map_copy_obj,