From: Kevin Day Date: Fri, 15 Mar 2024 02:40:45 +0000 (-0500) Subject: Refactor: The map "name" into "key" for the f_utf project. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=bc1cff3de0839c1267b64d5be30ddb8288c436f8;p=fll Refactor: The map "name" into "key" for the f_utf project. The commit 3fbd696f05704214ad4b6d508ae201f10c4adc5d failed to include the f_utf project. --- diff --git a/level_0/f_utf/c/utf/map.h b/level_0/f_utf/c/utf/map.h index d1987b5..b3a9b3c 100644 --- a/level_0/f_utf/c/utf/map.h +++ b/level_0/f_utf/c/utf/map.h @@ -25,16 +25,16 @@ extern "C" { */ #ifndef _di_f_utf_string_map_t_ typedef struct { - f_utf_string_dynamic_t name; + f_utf_string_dynamic_t key; f_utf_string_dynamic_t value; } f_utf_string_map_t; #define f_utf_string_map_t_initialize { f_utf_string_dynamic_t_initialize, f_utf_string_dynamic_t_initialize } - #define macro_f_utf_string_map_t_initialize_1(name, value) { name, value } + #define macro_f_utf_string_map_t_initialize_1(key, value) { key, value } #define macro_f_utf_string_map_t_clear(map) \ - macro_f_utf_string_dynamic_t_clear(map.name) \ + macro_f_utf_string_dynamic_t_clear(map.key) \ macro_f_utf_string_dynamic_t_clear(map.value) #endif // _di_f_utf_string_map_t_ diff --git a/level_0/f_utf/c/utf/map_multi.h b/level_0/f_utf/c/utf/map_multi.h index 69de59d..11c9f8c 100644 --- a/level_0/f_utf/c/utf/map_multi.h +++ b/level_0/f_utf/c/utf/map_multi.h @@ -17,7 +17,7 @@ extern "C" { #endif /** - * A string map consisting of a name and multiple values. + * A string map consisting of a key and multiple values. * * Properties: * - key: A string representing the map key. @@ -25,16 +25,16 @@ extern "C" { */ #ifndef _di_f_utf_string_map_multi_t_ typedef struct { - f_utf_string_dynamic_t name; + f_utf_string_dynamic_t key; f_utf_string_dynamics_t value; } f_utf_string_map_multi_t; #define f_utf_string_map_multi_t_initialize { f_utf_string_dynamic_t_initialize, f_utf_string_dynamics_t_initialize } - #define macro_f_utf_string_map_multi_t_initialize_1(name, value) { name, value } + #define macro_f_utf_string_map_multi_t_initialize_1(key, value) { key, value } #define macro_f_utf_string_map_multi_t_clear(map) \ - macro_f_utf_string_dynamic_t_clear(map.name) \ + macro_f_utf_string_dynamic_t_clear(map.key) \ macro_f_utf_string_dynamics_t_clear(map.value) #endif // _di_f_utf_string_map_multi_t_ diff --git a/level_0/f_utf/c/utf/map_multis.c b/level_0/f_utf/c/utf/map_multis.c index 7d159c2..7d8dd02 100644 --- a/level_0/f_utf/c/utf/map_multis.c +++ b/level_0/f_utf/c/utf/map_multis.c @@ -18,11 +18,11 @@ extern "C" { f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_map_multi_t), (void **) &destination->array, &destination->used, &destination->size); if (F_status_is_error(status)) return status; - destination->array[destination->used].name.used = 0; + destination->array[destination->used].key.used = 0; destination->array[destination->used].value.used = 0; - if (source.name.used) { - status = private_f_utf_string_append(source.name.string, source.name.used, &destination->array[destination->used].name); + if (source.key.used) { + status = private_f_utf_string_append(source.key.string, source.key.used, &destination->array[destination->used].key); if (F_status_is_error(status)) return status; } @@ -60,8 +60,8 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - if (array[i].name.size && array[i].name.string) { - status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size); + if (array[i].key.size && array[i].key.string) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size); if (F_status_is_error(status)) return status; } @@ -94,8 +94,8 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - if (array[i].name.size && array[i].name.string) { - status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size); + if (array[i].key.size && array[i].key.string) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_utf/c/utf/map_multiss.c b/level_0/f_utf/c/utf/map_multiss.c index 30559fc..50c7734 100644 --- a/level_0/f_utf/c/utf/map_multiss.c +++ b/level_0/f_utf/c/utf/map_multiss.c @@ -72,8 +72,8 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { if (array[i].size && array[i].array) { - if (array[i].array[j].name.size && array[i].array[j].name.string) { - status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size); + if (array[i].array[j].key.size && array[i].array[j].key.string) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].key.string, &array[i].array[j].key.used, &array[i].array[j].key.size); if (F_status_is_error(status)) return status; } @@ -112,8 +112,8 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { if (array[i].size && array[i].array) { - if (array[i].array[j].name.size && array[i].array[j].name.string) { - status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size); + if (array[i].array[j].key.size && array[i].array[j].key.string) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].key.string, &array[i].array[j].key.used, &array[i].array[j].key.size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_utf/c/utf/maps.c b/level_0/f_utf/c/utf/maps.c index 88b1efe..5346ce0 100644 --- a/level_0/f_utf/c/utf/maps.c +++ b/level_0/f_utf/c/utf/maps.c @@ -16,11 +16,11 @@ extern "C" { { f_status_t status = f_memory_array_increase(F_memory_default_allocation_small_d, sizeof(f_utf_string_map_t), (void **) &destination->array, &destination->used, &destination->size); - destination->array[destination->used].name.used = 0; + destination->array[destination->used].key.used = 0; destination->array[destination->used].value.used = 0; - if (source.name.used) { - status = private_f_utf_string_append(source.name.string, source.name.used, &destination->array[destination->used].name); + if (source.key.used) { + status = private_f_utf_string_append(source.key.string, source.key.used, &destination->array[destination->used].key); if (F_status_is_error(status)) return status; } @@ -57,8 +57,8 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - if (array[i].name.size && array[i].name.string) { - status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size); + if (array[i].key.size && array[i].key.string) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size); if (F_status_is_error(status)) return status; } @@ -82,8 +82,8 @@ extern "C" { for (f_number_unsigned_t i = start; i < stop; ++i) { - if (array[i].name.size && array[i].name.string) { - status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].name.string, &array[i].name.used, &array[i].name.size); + if (array[i].key.size && array[i].key.string) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].key.string, &array[i].key.used, &array[i].key.size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_utf/c/utf/mapss.c b/level_0/f_utf/c/utf/mapss.c index e0cac98..c5581d5 100644 --- a/level_0/f_utf/c/utf/mapss.c +++ b/level_0/f_utf/c/utf/mapss.c @@ -73,8 +73,8 @@ extern "C" { if (array[i].size && array[i].array) { for (j = 0; j < array[i].size; ++j) { - if (array[i].array[j].name.size && array[i].array[j].name.string) { - status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size); + if (array[i].array[j].key.size && array[i].array[j].key.string) { + status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &array[i].array[j].key.string, &array[i].array[j].key.used, &array[i].array[j].key.size); if (F_status_is_error(status)) return status; } @@ -107,8 +107,8 @@ extern "C" { if (array[i].size && array[i].array) { for (j = 0; j < array[i].size; ++j) { - if (array[i].array[j].name.size && array[i].array[j].name.string) { - status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].name.string, &array[i].array[j].name.used, &array[i].array[j].name.size); + if (array[i].array[j].key.size && array[i].array[j].key.string) { + status = f_memory_array_adjust(0, sizeof(f_char_t), (void **) &array[i].array[j].key.string, &array[i].array[j].key.used, &array[i].array[j].key.size); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_utf/c/utf/private-map_multis.c b/level_0/f_utf/c/utf/private-map_multis.c index 10dcb71..2464281 100644 --- a/level_0/f_utf/c/utf/private-map_multis.c +++ b/level_0/f_utf/c/utf/private-map_multis.c @@ -17,11 +17,11 @@ extern "C" { for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].name.used = 0; + destination->array[destination->used].key.used = 0; destination->array[destination->used].value.used = 0; - if (source.array[i].name.used) { - status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name); + if (source.array[i].key.used) { + status = private_f_utf_string_append(source.array[i].key.string, source.array[i].key.used, &destination->array[destination->used].key); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_utf/c/utf/private-maps.c b/level_0/f_utf/c/utf/private-maps.c index f5e5175..b93ff7f 100644 --- a/level_0/f_utf/c/utf/private-maps.c +++ b/level_0/f_utf/c/utf/private-maps.c @@ -16,11 +16,11 @@ extern "C" { for (f_number_unsigned_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].name.used = 0; + destination->array[destination->used].key.used = 0; destination->array[destination->used].value.used = 0; - if (source.array[i].name.used) { - status = private_f_utf_string_append(source.array[i].name.string, source.array[i].name.used, &destination->array[destination->used].name); + if (source.array[i].key.used) { + status = private_f_utf_string_append(source.array[i].key.string, source.array[i].key.used, &destination->array[destination->used].key); if (F_status_is_error(status)) return status; } diff --git a/level_0/f_utf/c/utf/private-mapss.c b/level_0/f_utf/c/utf/private-mapss.c deleted file mode 100644 index 73fc4c9..0000000 --- a/level_0/f_utf/c/utf/private-mapss.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "../utf.h" -#include "../private-utf.h" -#include "private-maps.h" -#include "private-mapss.h" -#include "private-string.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_0/f_utf/c/utf/private-mapss.h b/level_0/f_utf/c/utf/private-mapss.h deleted file mode 100644 index b6ae83d..0000000 --- a/level_0/f_utf/c/utf/private-mapss.h +++ /dev/null @@ -1,22 +0,0 @@ -/** - * FLL - Level 0 - * - * Project: UTF - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * These are provided for internal reduction in redundant code. - * These should not be exposed/used outside of this project. - */ -#ifndef _PRIVATE_F_utf_mapss_h -#define _PRIVATE_F_utf_mapss_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _PRIVATE_F_utf_mapss_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c index 2216dc2..2aa8e20 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append.c @@ -16,17 +16,17 @@ void test__f_utf_string_map_multis_append__works(void **state) { macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11), }; - const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9); + const f_utf_string_static_t test_key = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9); const f_utf_string_statics_t test_value = macro_f_utf_string_statics_t_initialize_1(test_value_array, 0, length_values); { - f_status_t status = f_utf_string_dynamic_append(test_name, &source.name); + f_status_t status = f_utf_string_dynamic_append(test_key, &source.key); assert_int_equal(status, F_okay); - assert_int_equal(source.name.used, test_name.used); + assert_int_equal(source.key.used, test_key.used); - for (f_number_unsigned_t i = 0; i < source.name.used; ++i) { - assert_int_equal(source.name.string[i], test_name.string[i]); + for (f_number_unsigned_t i = 0; i < source.key.used; ++i) { + assert_int_equal(source.key.string[i], test_key.string[i]); } // for status = f_utf_string_dynamics_append_all(test_value, &source.value); @@ -50,17 +50,17 @@ void test__f_utf_string_map_multis_append__works(void **state) { assert_int_equal(status, F_okay); assert_int_equal(destination.used, 1); - assert_int_equal(destination.array[0].name.used, source.name.used); + assert_int_equal(destination.array[0].key.used, source.key.used); assert_int_equal(destination.array[0].value.used, source.value.used); assert_int_equal(destination.array[0].value.array[0].used, source.value.array[0].used); assert_int_equal(destination.array[0].value.array[1].used, source.value.array[1].used); - assert_string_equal(destination.array[0].name.string, source.name.string); + assert_string_equal(destination.array[0].key.string, source.key.string); assert_string_equal(destination.array[0].value.array[0].string, source.value.array[0].string); assert_string_equal(destination.array[0].value.array[1].string, source.value.array[1].string); - for (f_number_unsigned_t j = 0; j < destination.array[0].name.used; ++j) { - assert_int_equal(destination.array[0].name.string[j], source.name.string[j]); + for (f_number_unsigned_t j = 0; j < destination.array[0].key.used; ++j) { + assert_int_equal(destination.array[0].key.string[j], source.key.string[j]); } // for for (f_number_unsigned_t j = 0; j < destination.array[0].value.array[0].used; ++j) { @@ -72,12 +72,12 @@ void test__f_utf_string_map_multis_append__works(void **state) { } // for } - free((void *) source.name.string); + free((void *) source.key.string); free((void *) source.value.array[0].string); free((void *) source.value.array[1].string); free((void *) source.value.array); - free((void *) destination.array[0].name.string); + free((void *) destination.array[0].key.string); free((void *) destination.array[0].value.array[0].string); free((void *) destination.array[0].value.array[1].string); free((void *) destination.array[0].value.array); diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c index 99608d1..03b97d5 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_append_all.c @@ -17,7 +17,7 @@ void test__f_utf_string_map_multis_append_all__works(void **state) { macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e\0\0\02\0\0\0", 0, 11), }; - const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9); + const f_utf_string_static_t test_key = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9); const f_utf_string_statics_t test_value = macro_f_utf_string_statics_t_initialize_1(test_value_array, 0, length_values); { @@ -28,11 +28,11 @@ void test__f_utf_string_map_multis_append_all__works(void **state) { for (; source.used < length_inner; ++source.used) { - status = f_utf_string_dynamic_append(test_name, &source.array[source.used].name); + status = f_utf_string_dynamic_append(test_key, &source.array[source.used].key); assert_int_equal(status, F_okay); - assert_string_equal(source.array[source.used].name.string, test_name.string); - assert_int_equal(source.array[source.used].name.used, test_name.used); + assert_string_equal(source.array[source.used].key.string, test_key.string); + assert_int_equal(source.array[source.used].key.used, test_key.used); status = f_utf_string_dynamics_append_all(test_value, &source.array[source.used].value); @@ -53,12 +53,12 @@ void test__f_utf_string_map_multis_append_all__works(void **state) { for (f_number_unsigned_t i = 0; i < length_inner; ++i) { - assert_int_equal(destination.array[i].name.used, source.array[i].name.used); + assert_int_equal(destination.array[i].key.used, source.array[i].key.used); assert_int_equal(destination.array[i].value.used, source.array[i].value.used); assert_int_equal(destination.array[i].value.array[0].used, source.array[i].value.array[0].used); assert_int_equal(destination.array[i].value.array[1].used, source.array[i].value.array[1].used); - assert_string_equal(destination.array[i].name.string, source.array[i].name.string); + assert_string_equal(destination.array[i].key.string, source.array[i].key.string); assert_string_equal(destination.array[i].value.array[0].string, source.array[i].value.array[0].string); assert_string_equal(destination.array[i].value.array[1].string, source.array[i].value.array[1].string); } // for @@ -66,7 +66,7 @@ void test__f_utf_string_map_multis_append_all__works(void **state) { for (f_number_unsigned_t i = 0; i < source.used; ++i) { - free((void *) source.array[i].name.string); + free((void *) source.array[i].key.string); free((void *) source.array[i].value.array[0].string); free((void *) source.array[i].value.array[1].string); free((void *) source.array[i].value.array); @@ -74,7 +74,7 @@ void test__f_utf_string_map_multis_append_all__works(void **state) { for (f_number_unsigned_t i = 0; i < destination.used; ++i) { - free((void *) destination.array[i].name.string); + free((void *) destination.array[i].key.string); free((void *) destination.array[i].value.array[0].string); free((void *) destination.array[i].value.array[1].string); free((void *) destination.array[i].value.array); diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_delete_callback.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_delete_callback.c index 4e4f210..7481075 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_delete_callback.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_delete_callback.c @@ -10,15 +10,15 @@ void test__f_utf_string_map_multis_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_utf_char_t name_string[] = { 'n', 0 }; + f_utf_char_t key_string[] = { 'n', 0 }; f_utf_char_t value_string[] = { 'v', 0 }; - f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t key = { .string = key_string, .used = 0, .size = 1 }; f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 }; f_utf_string_dynamic_t value_array[] = { value }; f_utf_string_dynamics_t values = { .array = value_array, .used = 0, .size = 1 }; - f_utf_string_map_multi_t data = { .name = name, .value = values }; + f_utf_string_map_multi_t data = { .key = key, .value = values }; f_utf_string_map_multi_t data_array[] = { data }; { @@ -30,7 +30,7 @@ void test__f_utf_string_map_multis_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } - data_array[0].name.size = 1; + data_array[0].key.size = 1; data_array[0].value.size = 1; data_array[0].value.array[0].size = 1; @@ -46,7 +46,7 @@ void test__f_utf_string_map_multis_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } - data_array[0].name.size = 1; + data_array[0].key.size = 1; data_array[0].value.size = 1; data_array[0].value.array[0].size = 1; @@ -79,7 +79,7 @@ void test__f_utf_string_map_multis_delete_callback__works(void **state) { f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_multi_t), (void **) &datas.array, &datas.used, &datas.size); assert_int_equal(status, F_okay); - status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size); + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size); assert_int_equal(status, F_okay); status = f_memory_array_resize(1, sizeof(f_utf_string_dynamic_t), (void **) &datas.array[0].value.array, &datas.array[0].value.used, &datas.array[0].value.size); @@ -93,11 +93,11 @@ void test__f_utf_string_map_multis_delete_callback__works(void **state) { const f_status_t status = f_utf_string_map_multis_delete_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].key.size, 0); assert_int_equal(datas.array[0].value.size, 0); } - free((void *) datas.array[0].name.string); + free((void *) datas.array[0].key.string); free((void *) datas.array[0].value.array); free((void *) datas.array); } diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multis_destroy_callback.c b/level_0/f_utf/tests/unit/c/test-utf-map_multis_destroy_callback.c index 91ab559..815e950 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multis_destroy_callback.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multis_destroy_callback.c @@ -10,15 +10,15 @@ void test__f_utf_string_map_multis_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_utf_char_t name_string[] = { 'n', 0 }; + f_utf_char_t key_string[] = { 'n', 0 }; f_utf_char_t value_string[] = { 'v', 0 }; - f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t key = { .string = key_string, .used = 0, .size = 1 }; f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 }; f_utf_string_dynamic_t value_array[] = { value }; f_utf_string_dynamics_t values = { .array = value_array, .used = 0, .size = 1 }; - f_utf_string_map_multi_t data = { .name = name, .value = values }; + f_utf_string_map_multi_t data = { .key = key, .value = values }; f_utf_string_map_multi_t data_array[] = { data }; { @@ -30,7 +30,7 @@ void test__f_utf_string_map_multis_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } - data_array[0].name.size = 1; + data_array[0].key.size = 1; data_array[0].value.size = 1; data_array[0].value.array[0].size = 1; @@ -46,7 +46,7 @@ void test__f_utf_string_map_multis_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } - data_array[0].name.size = 1; + data_array[0].key.size = 1; data_array[0].value.size = 1; data_array[0].value.array[0].size = 1; @@ -79,7 +79,7 @@ void test__f_utf_string_map_multis_destroy_callback__works(void **state) { f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_multi_t), (void **) &datas.array, &datas.used, &datas.size); assert_int_equal(status, F_okay); - status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size); + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size); assert_int_equal(status, F_okay); status = f_memory_array_resize(1, sizeof(f_utf_string_dynamic_t), (void **) &datas.array[0].value.array, &datas.array[0].value.used, &datas.array[0].value.size); @@ -93,11 +93,11 @@ void test__f_utf_string_map_multis_destroy_callback__works(void **state) { const f_status_t status = f_utf_string_map_multis_destroy_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].key.size, 0); assert_int_equal(datas.array[0].value.size, 0); } - free((void *) datas.array[0].name.string); + free((void *) datas.array[0].key.string); free((void *) datas.array[0].value.array); free((void *) datas.array); } diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c index 9ce16b5..cf3d8d1 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append.c @@ -40,11 +40,11 @@ void test__f_utf_string_map_multiss_append__works(void **state) { for (; source.used < length_inner; ++source.used) { - status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].name); + status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].key); assert_int_equal(status, F_okay); - assert_string_equal(source.array[source.used].name.string, test_names[source.used].string); - assert_int_equal(source.array[source.used].name.used, test_names[source.used].used); + assert_string_equal(source.array[source.used].key.string, test_names[source.used].string); + assert_int_equal(source.array[source.used].key.used, test_names[source.used].used); status = f_utf_string_dynamics_append_all(test_values[source.used], &source.array[source.used].value); @@ -66,12 +66,12 @@ void test__f_utf_string_map_multiss_append__works(void **state) { for (f_number_unsigned_t i = 0; i < length_inner; ++i) { - assert_int_equal(destination.array[0].array[i].name.used, test_names[i].used); + assert_int_equal(destination.array[0].array[i].key.used, test_names[i].used); assert_int_equal(destination.array[0].array[i].value.used, test_values[i].used); assert_int_equal(destination.array[0].array[i].value.array[0].used, test_values[i].array[0].used); assert_int_equal(destination.array[0].array[i].value.array[1].used, test_values[i].array[1].used); - assert_string_equal(destination.array[0].array[i].name.string, test_names[i].string); + assert_string_equal(destination.array[0].array[i].key.string, test_names[i].string); assert_string_equal(destination.array[0].array[i].value.array[0].string, test_values[i].array[0].string); assert_string_equal(destination.array[0].array[i].value.array[1].string, test_values[i].array[1].string); } // for @@ -79,7 +79,7 @@ void test__f_utf_string_map_multiss_append__works(void **state) { for (f_number_unsigned_t i = 0; i < source.used; ++i) { - free((void *) source.array[i].name.string); + free((void *) source.array[i].key.string); free((void *) source.array[i].value.array[0].string); free((void *) source.array[i].value.array[1].string); free((void *) source.array[i].value.array); @@ -88,7 +88,7 @@ void test__f_utf_string_map_multiss_append__works(void **state) { for (f_number_unsigned_t i = 0; i < destination.array[0].used; ++i) { - free((void *) destination.array[0].array[i].name.string); + free((void *) destination.array[0].array[i].key.string); free((void *) destination.array[0].array[i].value.array[0].string); free((void *) destination.array[0].array[i].value.array[1].string); free((void *) destination.array[0].array[i].value.array); diff --git a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c index 00b4cdc..09f1e35 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-map_multiss_append_all.c @@ -52,11 +52,11 @@ void test__f_utf_string_map_multiss_append_all__works(void **state) { for (i = 0; i < length_inner; ++i) { - status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].name); + status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].key); assert_int_equal(status, F_okay); - assert_int_equal(source.array[source.used].array[i].name.used, test_names[i].used); - assert_string_equal(source.array[source.used].array[i].name.string, test_names[i].string); + assert_int_equal(source.array[source.used].array[i].key.used, test_names[i].used); + assert_string_equal(source.array[source.used].array[i].key.string, test_names[i].string); status = f_utf_string_dynamics_append_all(test_values[i], &source.array[source.used].array[i].value); @@ -83,12 +83,12 @@ void test__f_utf_string_map_multiss_append_all__works(void **state) { for (f_number_unsigned_t i = 0; i < length_inner; ++i) { - assert_int_equal(destination.array[j].array[i].name.used, test_names[i].used); + assert_int_equal(destination.array[j].array[i].key.used, test_names[i].used); assert_int_equal(destination.array[j].array[i].value.used, test_values[i].used); assert_int_equal(destination.array[j].array[i].value.array[0].used, test_values[i].array[0].used); assert_int_equal(destination.array[j].array[i].value.array[1].used, test_values[i].array[1].used); - assert_string_equal(destination.array[j].array[i].name.string, test_names[i].string); + assert_string_equal(destination.array[j].array[i].key.string, test_names[i].string); assert_string_equal(destination.array[j].array[i].value.array[0].string, test_values[i].array[0].string); assert_string_equal(destination.array[j].array[i].value.array[1].string, test_values[i].array[1].string); } // for @@ -99,7 +99,7 @@ void test__f_utf_string_map_multiss_append_all__works(void **state) { for (f_number_unsigned_t i = 0; i < source.array[j].used; ++i) { - free((void *) source.array[j].array[i].name.string); + free((void *) source.array[j].array[i].key.string); free((void *) source.array[j].array[i].value.array[0].string); free((void *) source.array[j].array[i].value.array[1].string); free((void *) source.array[j].array[i].value.array); @@ -112,7 +112,7 @@ void test__f_utf_string_map_multiss_append_all__works(void **state) { for (f_number_unsigned_t i = 0; i < destination.array[j].used; ++i) { - free((void *) destination.array[j].array[i].name.string); + free((void *) destination.array[j].array[i].key.string); free((void *) destination.array[j].array[i].value.array[0].string); free((void *) destination.array[j].array[i].value.array[1].string); free((void *) destination.array[j].array[i].value.array); diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_append.c b/level_0/f_utf/tests/unit/c/test-utf-maps_append.c index 639117a..b9d7b91 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_append.c @@ -10,15 +10,15 @@ void test__f_utf_string_maps_append__works(void **state) { f_utf_string_map_t source = f_utf_string_map_t_initialize; f_utf_string_maps_t destination = f_utf_string_maps_t_initialize; - const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9); + const f_utf_string_static_t test_key = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9); const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e", 0, 10); { - f_status_t status = f_utf_string_dynamic_append(test_name, &source.name); + f_status_t status = f_utf_string_dynamic_append(test_key, &source.key); assert_int_equal(status, F_okay); - assert_string_equal(source.name.string, test_name.string); - assert_int_equal(source.name.used, test_name.used); + assert_string_equal(source.key.string, test_key.string); + assert_int_equal(source.key.used, test_key.used); status = f_utf_string_dynamic_append(test_value, &source.value); @@ -32,16 +32,16 @@ void test__f_utf_string_maps_append__works(void **state) { assert_int_equal(status, F_okay); assert_int_equal(destination.used, 1); - assert_int_equal(destination.array[0].name.used, source.name.used); + assert_int_equal(destination.array[0].key.used, source.key.used); assert_int_equal(destination.array[0].value.used, source.value.used); - assert_string_equal(destination.array[0].name.string, source.name.string); + assert_string_equal(destination.array[0].key.string, source.key.string); assert_string_equal(destination.array[0].value.string, source.value.string); } - free((void *) source.name.string); + free((void *) source.key.string); free((void *) source.value.string); - free((void *) destination.array[0].name.string); + free((void *) destination.array[0].key.string); free((void *) destination.array[0].value.string); free((void *) destination.array); diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c index 5380eda..e397e24 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_append_all.c @@ -11,7 +11,7 @@ void test__f_utf_string_maps_append_all__works(void **state) { f_utf_string_maps_t source = f_utf_string_maps_t_initialize; f_utf_string_maps_t destination = f_utf_string_maps_t_initialize; - const f_utf_string_static_t test_name = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9); + const f_utf_string_static_t test_key = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0n\0\0\0a\0\0\0m\0\0\0e", 0, 9); const f_utf_string_static_t test_value = macro_f_utf_string_static_t_initialize_1((f_utf_string_t) "\0\0\0t\0\0\0e\0\0\0s\0\0\0t\0\0\0_\0\0\0v\0\0\0a\0\0\0l\0\0\0u\0\0\0e", 0, 10); { @@ -22,11 +22,11 @@ void test__f_utf_string_maps_append_all__works(void **state) { for (; source.used < length_inner; ++source.used) { - status = f_utf_string_dynamic_append(test_name, &source.array[source.used].name); + status = f_utf_string_dynamic_append(test_key, &source.array[source.used].key); assert_int_equal(status, F_okay); - assert_string_equal(source.array[source.used].name.string, test_name.string); - assert_int_equal(source.array[source.used].name.used, test_name.used); + assert_string_equal(source.array[source.used].key.string, test_key.string); + assert_int_equal(source.array[source.used].key.used, test_key.used); status = f_utf_string_dynamic_append(test_value, &source.array[source.used].value); @@ -45,23 +45,23 @@ void test__f_utf_string_maps_append_all__works(void **state) { for (f_number_unsigned_t i = 0; i < length_inner; ++i) { - assert_int_equal(destination.array[i].name.used, source.array[i].name.used); + assert_int_equal(destination.array[i].key.used, source.array[i].key.used); assert_int_equal(destination.array[i].value.used, source.array[i].value.used); - assert_string_equal(destination.array[i].name.string, source.array[i].name.string); + assert_string_equal(destination.array[i].key.string, source.array[i].key.string); assert_string_equal(destination.array[i].value.string, source.array[i].value.string); } // for } for (f_number_unsigned_t i = 0; i < source.used; ++i) { - free((void *) source.array[i].name.string); + free((void *) source.array[i].key.string); free((void *) source.array[i].value.string); } // for for (f_number_unsigned_t i = 0; i < destination.used; ++i) { - free((void *) destination.array[i].name.string); + free((void *) destination.array[i].key.string); free((void *) destination.array[i].value.string); } // for diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback..c b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback..c index fb89c62..d4e9a57 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback..c +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback..c @@ -10,13 +10,13 @@ void test__f_utf_string_maps_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_utf_char_t name_string[] = { 'n', 0 }; + f_utf_char_t key_string[] = { 'n', 0 }; f_utf_char_t value_string[] = { 'v', 0 }; - f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t key = { .string = key_string, .used = 0, .size = 1 }; f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 }; - f_utf_string_map_t data = { .name = name, .value = value }; + f_utf_string_map_t data = { .key = key, .value = value }; f_utf_string_map_t data_array[] = { data }; { @@ -28,7 +28,7 @@ void test__f_utf_string_maps_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } - data_array[0].name.size = 1; + data_array[0].key.size = 1; data_array[0].value.size = 1; { @@ -57,7 +57,7 @@ void test__f_utf_string_maps_delete_callback__works(void **state) { f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_t), (void **) &datas.array, &datas.used, &datas.size); assert_int_equal(status, F_okay); - status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size); + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size); assert_int_equal(status, F_okay); status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size); @@ -71,7 +71,7 @@ void test__f_utf_string_maps_delete_callback__works(void **state) { assert_int_equal(datas.size, 0); } - free((void *) datas.array[0].name.string); + free((void *) datas.array[0].key.string); free((void *) datas.array[0].value.string); free((void *) datas.array); } diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback.c b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback.c index 5f86862..d57ebb2 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback.c +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_delete_callback.c @@ -10,13 +10,13 @@ void test__f_utf_string_maps_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_utf_char_t name_string[] = { 'n', 0 }; + f_utf_char_t key_string[] = { 'n', 0 }; f_utf_char_t value_string[] = { 'v', 0 }; - f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t key = { .string = key_string, .used = 0, .size = 1 }; f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 }; - f_utf_string_map_t data = { .name = name, .value = value }; + f_utf_string_map_t data = { .key = key, .value = value }; f_utf_string_map_t data_array[] = { data }; { @@ -28,7 +28,7 @@ void test__f_utf_string_maps_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } - data_array[0].name.size = 1; + data_array[0].key.size = 1; data_array[0].value.size = 1; { @@ -57,7 +57,7 @@ void test__f_utf_string_maps_delete_callback__works(void **state) { f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_t), (void **) &datas.array, &datas.used, &datas.size); assert_int_equal(status, F_okay); - status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size); + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size); assert_int_equal(status, F_okay); status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size); @@ -68,11 +68,11 @@ void test__f_utf_string_maps_delete_callback__works(void **state) { const f_status_t status = f_utf_string_maps_delete_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].key.size, 0); assert_int_equal(datas.array[0].value.size, 0); } - free((void *) datas.array[0].name.string); + free((void *) datas.array[0].key.string); free((void *) datas.array[0].value.string); free((void *) datas.array); } diff --git a/level_0/f_utf/tests/unit/c/test-utf-maps_destroy_callback.c b/level_0/f_utf/tests/unit/c/test-utf-maps_destroy_callback.c index 921b15e..ff04d49 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-maps_destroy_callback.c +++ b/level_0/f_utf/tests/unit/c/test-utf-maps_destroy_callback.c @@ -10,13 +10,13 @@ void test__f_utf_string_maps_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_utf_char_t name_string[] = { 'n', 0 }; + f_utf_char_t key_string[] = { 'n', 0 }; f_utf_char_t value_string[] = { 'v', 0 }; - f_utf_string_dynamic_t name = { .string = name_string, .used = 0, .size = 1 }; + f_utf_string_dynamic_t key = { .string = key_string, .used = 0, .size = 1 }; f_utf_string_dynamic_t value = { .string = value_string, .used = 0, .size = 1 }; - f_utf_string_map_t data = { .name = name, .value = value }; + f_utf_string_map_t data = { .key = key, .value = value }; f_utf_string_map_t data_array[] = { data }; { @@ -28,7 +28,7 @@ void test__f_utf_string_maps_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } - data_array[0].name.size = 1; + data_array[0].key.size = 1; data_array[0].value.size = 1; { @@ -57,7 +57,7 @@ void test__f_utf_string_maps_destroy_callback__works(void **state) { f_status_t status = f_memory_array_resize(length, sizeof(f_utf_string_map_t), (void **) &datas.array, &datas.used, &datas.size); assert_int_equal(status, F_okay); - status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].name.string, &datas.array[0].name.used, &datas.array[0].name.size); + status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].key.string, &datas.array[0].key.used, &datas.array[0].key.size); assert_int_equal(status, F_okay); status = f_memory_array_resize(1, sizeof(f_char_t), (void **) &datas.array[0].value.string, &datas.array[0].value.used, &datas.array[0].value.size); @@ -68,11 +68,11 @@ void test__f_utf_string_maps_destroy_callback__works(void **state) { const f_status_t status = f_utf_string_maps_destroy_callback(0, length, (void *) datas.array); assert_int_equal(status, F_okay); - assert_int_equal(datas.array[0].name.size, 0); + assert_int_equal(datas.array[0].key.size, 0); assert_int_equal(datas.array[0].value.size, 0); } - free((void *) datas.array[0].name.string); + free((void *) datas.array[0].key.string); free((void *) datas.array[0].value.string); free((void *) datas.array); } diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c index aa09f3c..eccbb10 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_append.c @@ -29,11 +29,11 @@ void test__f_utf_string_mapss_append__works(void **state) { for (; source.used < length_inner; ++source.used) { - status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].name); + status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].key); assert_int_equal(status, F_okay); - assert_string_equal(source.array[source.used].name.string, test_names[source.used].string); - assert_int_equal(source.array[source.used].name.used, test_names[source.used].used); + assert_string_equal(source.array[source.used].key.string, test_names[source.used].string); + assert_int_equal(source.array[source.used].key.used, test_names[source.used].used); status = f_utf_string_dynamic_append(test_values[source.used], &source.array[source.used].value); @@ -51,24 +51,24 @@ void test__f_utf_string_mapss_append__works(void **state) { for (f_number_unsigned_t i = 0; i < length_inner; ++i) { - assert_int_equal(destination.array[0].array[i].name.used, test_names[i].used); + assert_int_equal(destination.array[0].array[i].key.used, test_names[i].used); assert_int_equal(destination.array[0].array[i].value.used, test_values[i].used); - assert_string_equal(destination.array[0].array[i].name.string, test_names[i].string); + assert_string_equal(destination.array[0].array[i].key.string, test_names[i].string); assert_string_equal(destination.array[0].array[i].value.string, test_values[i].string); } // for } for (f_number_unsigned_t i = 0; i < source.used; ++i) { - free((void *) source.array[i].name.string); + free((void *) source.array[i].key.string); free((void *) source.array[i].value.string); } // for for (f_number_unsigned_t i = 0; i < destination.array[0].used; ++i) { - free((void *) destination.array[0].array[i].name.string); + free((void *) destination.array[0].array[i].key.string); free((void *) destination.array[0].array[i].value.string); } // for diff --git a/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c b/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c index 21c4346..a3d9656 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c +++ b/level_0/f_utf/tests/unit/c/test-utf-mapss_append_all.c @@ -41,11 +41,11 @@ void test__f_utf_string_mapss_append_all__works(void **state) { for (i = 0; i < length_inner; ++i) { - status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].name); + status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].key); assert_int_equal(status, F_okay); - assert_string_equal(source.array[source.used].array[i].name.string, test_names[i].string); - assert_int_equal(source.array[source.used].array[i].name.used, test_names[i].used); + assert_string_equal(source.array[source.used].array[i].key.string, test_names[i].string); + assert_int_equal(source.array[source.used].array[i].key.used, test_names[i].used); status = f_utf_string_dynamic_append(test_values[i], &source.array[source.used].array[i].value); @@ -68,10 +68,10 @@ void test__f_utf_string_mapss_append_all__works(void **state) { for (f_number_unsigned_t i = 0; i < length_inner; ++i) { - assert_int_equal(destination.array[j].array[i].name.used, test_names[i].used); + assert_int_equal(destination.array[j].array[i].key.used, test_names[i].used); assert_int_equal(destination.array[j].array[i].value.used, test_values[i].used); - assert_string_equal(destination.array[j].array[i].name.string, test_names[i].string); + assert_string_equal(destination.array[j].array[i].key.string, test_names[i].string); assert_string_equal(destination.array[j].array[i].value.string, test_values[i].string); } // for } // for @@ -81,7 +81,7 @@ void test__f_utf_string_mapss_append_all__works(void **state) { for (f_number_unsigned_t i = 0; i < source.array[j].used; ++i) { - free((void *) source.array[j].array[i].name.string); + free((void *) source.array[j].array[i].key.string); free((void *) source.array[j].array[i].value.string); } // for @@ -92,7 +92,7 @@ void test__f_utf_string_mapss_append_all__works(void **state) { for (f_number_unsigned_t i = 0; i < destination.array[j].used; ++i) { - free((void *) destination.array[j].array[i].name.string); + free((void *) destination.array[j].array[i].key.string); free((void *) destination.array[j].array[i].value.string); } // for