From 2364055d3a68b477eda68353ccad4cc333e5131b Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 31 Aug 2023 23:09:29 -0500 Subject: [PATCH] Update: Fix unit tests after adding additional sanity checks. The commit 3dee02180d1ab33471e57b17c1485532fee1c597 introduced additional sanity checks. Several unit checks did as little as necessary to perform the tests when it comes to mocking. The additional sanity checks impose additional restrictions. --- .../tests/unit/c/test-account-s_delete_callback.c | 37 ++++- .../tests/unit/c/test-account-s_destroy_callback.c | 37 ++++- .../tests/unit/c/test-account-ss_delete_callback.c | 43 +++++- .../unit/c/test-account-ss_destroy_callback.c | 43 +++++- .../c/test-directory-listings_delete_callback.c | 97 ++++++++++-- .../c/test-directory-listings_destroy_callback.c | 97 ++++++++++-- .../c/test-directory-listingss_delete_callback.c | 94 +++++++++++- .../c/test-directory-listingss_destroy_callback.c | 94 +++++++++++- .../c/test-directory-recurse_dos_delete_callback.c | 143 ++++++++++++++++-- .../test-directory-recurse_dos_destroy_callback.c | 143 ++++++++++++++++-- .../test-directory-recurse_doss_delete_callback.c | 168 +++++++++++++++++++-- .../test-directory-recurse_doss_destroy_callback.c | 168 +++++++++++++++++++-- .../c/test-directory-statusss_delete_callback.c | 15 +- .../c/test-directory-statusss_destroy_callback.c | 15 +- level_0/f_directory/tests/unit/c/test-directory.c | 36 ++--- level_0/f_directory/tests/unit/c/test-directory.h | 12 +- .../tests/unit/c/test-fss-items_delete_callback.c | 10 +- .../tests/unit/c/test-fss-items_destroy_callback.c | 10 +- .../tests/unit/c/test-fss-itemss_delete_callback.c | 12 +- .../unit/c/test-fss-itemss_destroy_callback.c | 12 +- level_0/f_fss/tests/unit/c/test-fss-named_delete.c | 21 ++- .../f_fss/tests/unit/c/test-fss-named_destroy.c | 21 ++- .../tests/unit/c/test-fss-nameds_delete_callback.c | 29 +++- .../unit/c/test-fss-nameds_destroy_callback.c | 29 +++- .../unit/c/test-fss-namedss_delete_callback.c | 25 ++- .../unit/c/test-fss-namedss_destroy_callback.c | 25 ++- .../tests/unit/c/test-fss-nests_delete_callback.c | 19 ++- .../tests/unit/c/test-fss-nests_destroy_callback.c | 19 ++- .../tests/unit/c/test-fss-nestss_delete_callback.c | 2 +- .../unit/c/test-fss-nestss_destroy_callback.c | 2 +- level_0/f_fss/tests/unit/c/test-fss-set_delete.c | 8 +- level_0/f_fss/tests/unit/c/test-fss-set_destroy.c | 8 +- .../f_fss/tests/unit/c/test-fss-set_quote_delete.c | 13 +- .../tests/unit/c/test-fss-set_quote_destroy.c | 13 +- .../unit/c/test-fss-set_quotes_delete_callback.c | 38 ++++- .../unit/c/test-fss-set_quotes_destroy_callback.c | 38 ++++- .../unit/c/test-fss-set_quotess_delete_callback.c | 33 +++- .../unit/c/test-fss-set_quotess_destroy_callback.c | 33 +++- .../tests/unit/c/test-fss-sets_delete_callback.c | 17 ++- .../tests/unit/c/test-fss-sets_destroy_callback.c | 17 ++- .../tests/unit/c/test-fss-setss_delete_callback.c | 14 +- .../tests/unit/c/test-fss-setss_destroy_callback.c | 14 +- .../tests/unit/c/test-fss-simple_packet_delete.c | 4 +- .../tests/unit/c/test-fss-simple_packet_destroy.c | 4 +- .../c/test-fss-simple_packets_delete_callback.c | 8 +- .../c/test-fss-simple_packets_destroy_callback.c | 8 +- .../c/test-fss-simple_packetss_delete_callback.c | 9 +- .../c/test-fss-simple_packetss_destroy_callback.c | 9 +- .../tests/unit/c/test-iki-datas_delete_callback.c | 39 +++-- .../tests/unit/c/test-iki-datas_destroy_callback.c | 39 +++-- .../tests/unit/c/test-iki-datass_delete_callback.c | 38 ++++- .../unit/c/test-iki-datass_destroy_callback.c | 38 ++++- 52 files changed, 1686 insertions(+), 234 deletions(-) diff --git a/level_0/f_account/tests/unit/c/test-account-s_delete_callback.c b/level_0/f_account/tests/unit/c/test-account-s_delete_callback.c index 6bb4669..c319e94 100644 --- a/level_0/f_account/tests/unit/c/test-account-s_delete_callback.c +++ b/level_0/f_account/tests/unit/c/test-account-s_delete_callback.c @@ -10,7 +10,18 @@ void test__f_accounts_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_account_t data = f_account_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_account_t data = { + .id_user = 0, + .id_group = 0, + .home = base, + .label = base, + .name = base, + .password = base, + .shell = base, + }; + f_account_t data_array[] = { data }; { @@ -22,6 +33,12 @@ void test__f_accounts_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].home = base; + data_array[0].label = base; + data_array[0].name = base; + data_array[0].password = base; + data_array[0].shell = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -34,6 +51,12 @@ void test__f_accounts_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].home = base; + data_array[0].label = base; + data_array[0].name = base; + data_array[0].password = base; + data_array[0].shell = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -49,6 +72,12 @@ void test__f_accounts_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].home = base; + data_array[0].label = base; + data_array[0].name = base; + data_array[0].password = base; + data_array[0].shell = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -67,6 +96,12 @@ void test__f_accounts_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].home = base; + data_array[0].label = base; + data_array[0].name = base; + data_array[0].password = base; + data_array[0].shell = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); diff --git a/level_0/f_account/tests/unit/c/test-account-s_destroy_callback.c b/level_0/f_account/tests/unit/c/test-account-s_destroy_callback.c index cef429c..a511cae 100644 --- a/level_0/f_account/tests/unit/c/test-account-s_destroy_callback.c +++ b/level_0/f_account/tests/unit/c/test-account-s_destroy_callback.c @@ -10,7 +10,18 @@ void test__f_accounts_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_account_t data = f_account_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_account_t data = { + .id_user = 0, + .id_group = 0, + .home = base, + .label = base, + .name = base, + .password = base, + .shell = base, + }; + f_account_t data_array[] = { data }; { @@ -22,6 +33,12 @@ void test__f_accounts_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].home = base; + data_array[0].label = base; + data_array[0].name = base; + data_array[0].password = base; + data_array[0].shell = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -34,6 +51,12 @@ void test__f_accounts_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].home = base; + data_array[0].label = base; + data_array[0].name = base; + data_array[0].password = base; + data_array[0].shell = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -49,6 +72,12 @@ void test__f_accounts_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].home = base; + data_array[0].label = base; + data_array[0].name = base; + data_array[0].password = base; + data_array[0].shell = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -67,6 +96,12 @@ void test__f_accounts_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].home = base; + data_array[0].label = base; + data_array[0].name = base; + data_array[0].password = base; + data_array[0].shell = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); diff --git a/level_0/f_account/tests/unit/c/test-account-ss_delete_callback.c b/level_0/f_account/tests/unit/c/test-account-ss_delete_callback.c index 54748c2..974f6d5 100644 --- a/level_0/f_account/tests/unit/c/test-account-ss_delete_callback.c +++ b/level_0/f_account/tests/unit/c/test-account-ss_delete_callback.c @@ -10,7 +10,18 @@ void test__f_accountss_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_account_t data = f_account_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_account_t data = { + .id_user = 0, + .id_group = 0, + .home = base, + .label = base, + .name = base, + .password = base, + .shell = base, + }; + f_account_t data_array[] = { data }; f_accounts_t datas = { .array = data_array, .used = 1, .size = 1 }; f_accounts_t datas_array[] = { datas }; @@ -24,6 +35,12 @@ void test__f_accountss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].home = base; + datas_array[0].array[0].label = base; + datas_array[0].array[0].name = base; + datas_array[0].array[0].password = base; + datas_array[0].array[0].shell = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -36,6 +53,12 @@ void test__f_accountss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].home = base; + datas_array[0].array[0].label = base; + datas_array[0].array[0].name = base; + datas_array[0].array[0].password = base; + datas_array[0].array[0].shell = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -51,6 +74,12 @@ void test__f_accountss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].home = base; + datas_array[0].array[0].label = base; + datas_array[0].array[0].name = base; + datas_array[0].array[0].password = base; + datas_array[0].array[0].shell = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -69,6 +98,12 @@ void test__f_accountss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].home = base; + datas_array[0].array[0].label = base; + datas_array[0].array[0].name = base; + datas_array[0].array[0].password = base; + datas_array[0].array[0].shell = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -90,6 +125,12 @@ void test__f_accountss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].home = base; + datas_array[0].array[0].label = base; + datas_array[0].array[0].name = base; + datas_array[0].array[0].password = base; + datas_array[0].array[0].shell = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); diff --git a/level_0/f_account/tests/unit/c/test-account-ss_destroy_callback.c b/level_0/f_account/tests/unit/c/test-account-ss_destroy_callback.c index 3da6379..ed81cd9 100644 --- a/level_0/f_account/tests/unit/c/test-account-ss_destroy_callback.c +++ b/level_0/f_account/tests/unit/c/test-account-ss_destroy_callback.c @@ -10,7 +10,18 @@ void test__f_accountss_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_account_t data = f_account_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_account_t data = { + .id_user = 0, + .id_group = 0, + .home = base, + .label = base, + .name = base, + .password = base, + .shell = base, + }; + f_account_t data_array[] = { data }; f_accounts_t datas = { .array = data_array, .used = 1, .size = 1 }; f_accounts_t datas_array[] = { datas }; @@ -24,6 +35,12 @@ void test__f_accountss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].home = base; + datas_array[0].array[0].label = base; + datas_array[0].array[0].name = base; + datas_array[0].array[0].password = base; + datas_array[0].array[0].shell = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -36,6 +53,12 @@ void test__f_accountss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].home = base; + datas_array[0].array[0].label = base; + datas_array[0].array[0].name = base; + datas_array[0].array[0].password = base; + datas_array[0].array[0].shell = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -51,6 +74,12 @@ void test__f_accountss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].home = base; + datas_array[0].array[0].label = base; + datas_array[0].array[0].name = base; + datas_array[0].array[0].password = base; + datas_array[0].array[0].shell = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -69,6 +98,12 @@ void test__f_accountss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].home = base; + datas_array[0].array[0].label = base; + datas_array[0].array[0].name = base; + datas_array[0].array[0].password = base; + datas_array[0].array[0].shell = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -90,6 +125,12 @@ void test__f_accountss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].home = base; + datas_array[0].array[0].label = base; + datas_array[0].array[0].name = base; + datas_array[0].array[0].password = base; + datas_array[0].array[0].shell = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); diff --git a/level_0/f_directory/tests/unit/c/test-directory-listings_delete_callback.c b/level_0/f_directory/tests/unit/c/test-directory-listings_delete_callback.c index 4d6b942..63b7024 100644 --- a/level_0/f_directory/tests/unit/c/test-directory-listings_delete_callback.c +++ b/level_0/f_directory/tests/unit/c/test-directory-listings_delete_callback.c @@ -10,20 +10,41 @@ void test__f_directory_listings_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_directory_listing_t data = f_directory_listing_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + f_string_static_t base_array[] = { base }; + f_string_statics_t bases = macro_f_string_statics_t_initialize_1(base_array, 1, 0); + + f_directory_listing_t data = { + .block = bases, + .character = bases, + .directory = bases, + .regular = bases, + .link = bases, + .fifo = bases, + .socket = bases, + .unknown = bases, + }; + f_directory_listing_t data_array[] = { data }; - f_directory_listings_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_directory_listings_t datas_array[] = { datas }; { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -31,11 +52,20 @@ void test__f_directory_listings_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -46,11 +76,20 @@ void test__f_directory_listings_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -64,11 +103,20 @@ void test__f_directory_listings_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -85,11 +133,20 @@ void test__f_directory_listings_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -109,11 +166,20 @@ void test__f_directory_listings_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -136,11 +202,20 @@ void test__f_directory_listings_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -166,7 +241,7 @@ void test__f_directory_listings_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_directory/tests/unit/c/test-directory-listings_destroy_callback.c b/level_0/f_directory/tests/unit/c/test-directory-listings_destroy_callback.c index 641b5bf..7aa41dd 100644 --- a/level_0/f_directory/tests/unit/c/test-directory-listings_destroy_callback.c +++ b/level_0/f_directory/tests/unit/c/test-directory-listings_destroy_callback.c @@ -10,20 +10,41 @@ void test__f_directory_listings_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_directory_listing_t data = f_directory_listing_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + f_string_static_t base_array[] = { base }; + f_string_statics_t bases = macro_f_string_statics_t_initialize_1(base_array, 1, 0); + + f_directory_listing_t data = { + .block = bases, + .character = bases, + .directory = bases, + .regular = bases, + .link = bases, + .fifo = bases, + .socket = bases, + .unknown = bases, + }; + f_directory_listing_t data_array[] = { data }; - f_directory_listings_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_directory_listings_t datas_array[] = { datas }; { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -31,11 +52,20 @@ void test__f_directory_listings_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -46,11 +76,20 @@ void test__f_directory_listings_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -64,11 +103,20 @@ void test__f_directory_listings_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -85,11 +133,20 @@ void test__f_directory_listings_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -109,11 +166,20 @@ void test__f_directory_listings_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -136,11 +202,20 @@ void test__f_directory_listings_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].block = bases; + data_array[0].character = bases; + data_array[0].directory = bases; + data_array[0].regular = bases; + data_array[0].link = bases; + data_array[0].fifo = bases; + data_array[0].socket = bases; + data_array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -166,7 +241,7 @@ void test__f_directory_listings_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_directory_listings_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_directory/tests/unit/c/test-directory-listingss_delete_callback.c b/level_0/f_directory/tests/unit/c/test-directory-listingss_delete_callback.c index fb69843..64851cc 100644 --- a/level_0/f_directory/tests/unit/c/test-directory-listingss_delete_callback.c +++ b/level_0/f_directory/tests/unit/c/test-directory-listingss_delete_callback.c @@ -10,9 +10,23 @@ void test__f_directory_listingss_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_directory_listing_t data = f_directory_listing_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + f_string_static_t base_array[] = { base }; + f_string_statics_t bases = macro_f_string_statics_t_initialize_1(base_array, 1, 0); + + f_directory_listing_t data = { + .block = bases, + .character = bases, + .directory = bases, + .regular = bases, + .link = bases, + .fifo = bases, + .socket = bases, + .unknown = bases, + }; + f_directory_listing_t data_array[] = { data }; - f_directory_listings_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_directory_listings_t datas = { .array = data_array, .used = 0, .size = 1 }; f_directory_listings_t datas_array[] = { datas }; { @@ -24,6 +38,16 @@ void test__f_directory_listingss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -36,6 +60,16 @@ void test__f_directory_listingss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -51,6 +85,16 @@ void test__f_directory_listingss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -69,6 +113,16 @@ void test__f_directory_listingss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -90,6 +144,15 @@ void test__f_directory_listingss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -114,6 +177,15 @@ void test__f_directory_listingss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -141,6 +213,15 @@ void test__f_directory_listingss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); @@ -171,6 +252,15 @@ void test__f_directory_listingss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_resize, false); will_return(__wrap_f_memory_arrays_resize, F_okay); diff --git a/level_0/f_directory/tests/unit/c/test-directory-listingss_destroy_callback.c b/level_0/f_directory/tests/unit/c/test-directory-listingss_destroy_callback.c index 9390411..80b83d1 100644 --- a/level_0/f_directory/tests/unit/c/test-directory-listingss_destroy_callback.c +++ b/level_0/f_directory/tests/unit/c/test-directory-listingss_destroy_callback.c @@ -10,9 +10,23 @@ void test__f_directory_listingss_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_directory_listing_t data = f_directory_listing_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + f_string_static_t base_array[] = { base }; + f_string_statics_t bases = macro_f_string_statics_t_initialize_1(base_array, 1, 0); + + f_directory_listing_t data = { + .block = bases, + .character = bases, + .directory = bases, + .regular = bases, + .link = bases, + .fifo = bases, + .socket = bases, + .unknown = bases, + }; + f_directory_listing_t data_array[] = { data }; - f_directory_listings_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_directory_listings_t datas = { .array = data_array, .used = 0, .size = 1 }; f_directory_listings_t datas_array[] = { datas }; { @@ -24,6 +38,16 @@ void test__f_directory_listingss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -36,6 +60,16 @@ void test__f_directory_listingss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -51,6 +85,16 @@ void test__f_directory_listingss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -69,6 +113,16 @@ void test__f_directory_listingss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -90,6 +144,15 @@ void test__f_directory_listingss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -114,6 +177,15 @@ void test__f_directory_listingss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -141,6 +213,15 @@ void test__f_directory_listingss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); @@ -171,6 +252,15 @@ void test__f_directory_listingss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].array[0].block = bases; + datas_array[0].array[0].character = bases; + datas_array[0].array[0].directory = bases; + datas_array[0].array[0].regular = bases; + datas_array[0].array[0].link = bases; + datas_array[0].array[0].fifo = bases; + datas_array[0].array[0].socket = bases; + datas_array[0].array[0].unknown = bases; + { will_return(__wrap_f_memory_arrays_adjust, false); will_return(__wrap_f_memory_arrays_adjust, F_okay); diff --git a/level_0/f_directory/tests/unit/c/test-directory-recurse_dos_delete_callback.c b/level_0/f_directory/tests/unit/c/test-directory-recurse_dos_delete_callback.c index 7509d42..f132f24 100644 --- a/level_0/f_directory/tests/unit/c/test-directory-recurse_dos_delete_callback.c +++ b/level_0/f_directory/tests/unit/c/test-directory-recurse_dos_delete_callback.c @@ -10,20 +10,49 @@ void test__f_directory_recurse_dos_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_directory_recurse_do_t data = f_directory_recurse_do_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + f_string_static_t base_array[] = { base }; + f_string_statics_t bases = macro_f_string_statics_t_initialize_1(base_array, 1, 0); + + f_directory_listing_t listing = { + .block = bases, + .character = bases, + .directory = bases, + .regular = bases, + .link = bases, + .fifo = bases, + .socket = bases, + .unknown = bases, + }; + + f_directory_recurse_do_t data = { + .listing = listing, + .path = base, + .path_cache = base, + }; + f_directory_recurse_do_t data_array[] = { data }; - f_directory_recurse_dos_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_directory_recurse_dos_t datass_array[] = { datas }; { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -31,11 +60,22 @@ void test__f_directory_recurse_dos_delete_callback__fails(void **state) { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -46,11 +86,22 @@ void test__f_directory_recurse_dos_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -64,11 +115,22 @@ void test__f_directory_recurse_dos_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -85,11 +147,22 @@ void test__f_directory_recurse_dos_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -109,11 +182,22 @@ void test__f_directory_recurse_dos_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -136,11 +220,22 @@ void test__f_directory_recurse_dos_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -166,11 +261,22 @@ void test__f_directory_recurse_dos_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -199,11 +305,22 @@ void test__f_directory_recurse_dos_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -235,7 +352,7 @@ void test__f_directory_recurse_dos_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_directory/tests/unit/c/test-directory-recurse_dos_destroy_callback.c b/level_0/f_directory/tests/unit/c/test-directory-recurse_dos_destroy_callback.c index b428b42..d694b27 100644 --- a/level_0/f_directory/tests/unit/c/test-directory-recurse_dos_destroy_callback.c +++ b/level_0/f_directory/tests/unit/c/test-directory-recurse_dos_destroy_callback.c @@ -10,20 +10,49 @@ void test__f_directory_recurse_dos_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_directory_recurse_do_t data = f_directory_recurse_do_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + f_string_static_t base_array[] = { base }; + f_string_statics_t bases = macro_f_string_statics_t_initialize_1(base_array, 1, 0); + + f_directory_listing_t listing = { + .block = bases, + .character = bases, + .directory = bases, + .regular = bases, + .link = bases, + .fifo = bases, + .socket = bases, + .unknown = bases, + }; + + f_directory_recurse_do_t data = { + .listing = listing, + .path = base, + .path_cache = base, + }; + f_directory_recurse_do_t data_array[] = { data }; - f_directory_recurse_dos_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_directory_recurse_dos_t datass_array[] = { datas }; { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -31,11 +60,22 @@ void test__f_directory_recurse_dos_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -46,11 +86,22 @@ void test__f_directory_recurse_dos_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -64,11 +115,22 @@ void test__f_directory_recurse_dos_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -85,11 +147,22 @@ void test__f_directory_recurse_dos_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -109,11 +182,22 @@ void test__f_directory_recurse_dos_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -136,11 +220,22 @@ void test__f_directory_recurse_dos_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -166,11 +261,22 @@ void test__f_directory_recurse_dos_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -199,11 +305,22 @@ void test__f_directory_recurse_dos_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].listing.block = bases; + data_array[0].listing.character = bases; + data_array[0].listing.directory = bases; + data_array[0].listing.regular = bases; + data_array[0].listing.link = bases; + data_array[0].listing.fifo = bases; + data_array[0].listing.socket = bases; + data_array[0].listing.unknown = bases; + data_array[0].path = base; + data_array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -235,7 +352,7 @@ void test__f_directory_recurse_dos_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_dos_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_directory/tests/unit/c/test-directory-recurse_doss_delete_callback.c b/level_0/f_directory/tests/unit/c/test-directory-recurse_doss_delete_callback.c index 64ad08c..eab60de 100644 --- a/level_0/f_directory/tests/unit/c/test-directory-recurse_doss_delete_callback.c +++ b/level_0/f_directory/tests/unit/c/test-directory-recurse_doss_delete_callback.c @@ -10,20 +10,52 @@ void test__f_directory_recurse_doss_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_directory_recurse_do_t data = f_directory_recurse_do_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + f_string_static_t base_array[] = { base }; + f_string_statics_t bases = macro_f_string_statics_t_initialize_1(base_array, 1, 0); + + f_directory_listing_t listing = { + .block = bases, + .character = bases, + .directory = bases, + .regular = bases, + .link = bases, + .fifo = bases, + .socket = bases, + .unknown = bases, + }; + + f_directory_recurse_do_t data = { + .listing = listing, + .path = base, + .path_cache = base, + }; + f_directory_recurse_do_t data_array[] = { data }; - f_directory_recurse_dos_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_directory_recurse_dos_t datass_array[] = { datas }; + f_directory_recurse_dos_t datas = { .array = data_array, .used = 0, .size = 1 }; + f_directory_recurse_dos_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -31,11 +63,23 @@ void test__f_directory_recurse_doss_delete_callback__fails(void **state) { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -46,11 +90,23 @@ void test__f_directory_recurse_doss_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -64,11 +120,23 @@ void test__f_directory_recurse_doss_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -85,11 +153,23 @@ void test__f_directory_recurse_doss_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -109,11 +189,23 @@ void test__f_directory_recurse_doss_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -136,11 +228,23 @@ void test__f_directory_recurse_doss_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -166,11 +270,23 @@ void test__f_directory_recurse_doss_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -199,11 +315,23 @@ void test__f_directory_recurse_doss_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -235,11 +363,23 @@ void test__f_directory_recurse_doss_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -274,7 +414,7 @@ void test__f_directory_recurse_doss_delete_callback__fails(void **state) { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_directory/tests/unit/c/test-directory-recurse_doss_destroy_callback.c b/level_0/f_directory/tests/unit/c/test-directory-recurse_doss_destroy_callback.c index 0a48a32..b2be796 100644 --- a/level_0/f_directory/tests/unit/c/test-directory-recurse_doss_destroy_callback.c +++ b/level_0/f_directory/tests/unit/c/test-directory-recurse_doss_destroy_callback.c @@ -10,20 +10,52 @@ void test__f_directory_recurse_doss_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_directory_recurse_do_t data = f_directory_recurse_do_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + f_string_static_t base_array[] = { base }; + f_string_statics_t bases = macro_f_string_statics_t_initialize_1(base_array, 1, 0); + + f_directory_listing_t listing = { + .block = bases, + .character = bases, + .directory = bases, + .regular = bases, + .link = bases, + .fifo = bases, + .socket = bases, + .unknown = bases, + }; + + f_directory_recurse_do_t data = { + .listing = listing, + .path = base, + .path_cache = base, + }; + f_directory_recurse_do_t data_array[] = { data }; - f_directory_recurse_dos_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_directory_recurse_dos_t datass_array[] = { datas }; + f_directory_recurse_dos_t datas = { .array = data_array, .used = 0, .size = 1 }; + f_directory_recurse_dos_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -31,11 +63,23 @@ void test__f_directory_recurse_doss_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -46,11 +90,23 @@ void test__f_directory_recurse_doss_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -64,11 +120,23 @@ void test__f_directory_recurse_doss_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -85,11 +153,23 @@ void test__f_directory_recurse_doss_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -109,11 +189,23 @@ void test__f_directory_recurse_doss_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -136,11 +228,23 @@ void test__f_directory_recurse_doss_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -166,11 +270,23 @@ void test__f_directory_recurse_doss_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -199,11 +315,23 @@ void test__f_directory_recurse_doss_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -235,11 +363,23 @@ void test__f_directory_recurse_doss_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].listing.block = bases; + datas_array[0].array[0].listing.character = bases; + datas_array[0].array[0].listing.directory = bases; + datas_array[0].array[0].listing.regular = bases; + datas_array[0].array[0].listing.link = bases; + datas_array[0].array[0].listing.fifo = bases; + datas_array[0].array[0].listing.socket = bases; + datas_array[0].array[0].listing.unknown = bases; + datas_array[0].array[0].path = base; + datas_array[0].array[0].path_cache = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -274,7 +414,7 @@ void test__f_directory_recurse_doss_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_recurse_doss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_directory/tests/unit/c/test-directory-statusss_delete_callback.c b/level_0/f_directory/tests/unit/c/test-directory-statusss_delete_callback.c index d5139b5..8a39532 100644 --- a/level_0/f_directory/tests/unit/c/test-directory-statusss_delete_callback.c +++ b/level_0/f_directory/tests/unit/c/test-directory-statusss_delete_callback.c @@ -10,20 +10,25 @@ void test__f_directory_statusss_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_directory_status_t data = f_directory_status_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_directory_status_t data = { .path = base }; f_directory_status_t data_array[] = { data }; - f_directory_statuss_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_directory_statuss_t datass_array[] = { datas }; + f_directory_statuss_t datas = { .array = data_array, .used = 0, .size = 1 }; + f_directory_statuss_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_statusss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_statusss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].path = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -31,7 +36,7 @@ void test__f_directory_statusss_delete_callback__fails(void **state) { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_directory_statusss_delete_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_statusss_delete_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_directory/tests/unit/c/test-directory-statusss_destroy_callback.c b/level_0/f_directory/tests/unit/c/test-directory-statusss_destroy_callback.c index dc3da45..4db93b1 100644 --- a/level_0/f_directory/tests/unit/c/test-directory-statusss_destroy_callback.c +++ b/level_0/f_directory/tests/unit/c/test-directory-statusss_destroy_callback.c @@ -10,20 +10,25 @@ void test__f_directory_statusss_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_directory_status_t data = f_directory_status_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_directory_status_t data = { .path = base }; f_directory_status_t data_array[] = { data }; - f_directory_statuss_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_directory_statuss_t datass_array[] = { datas }; + f_directory_statuss_t datas = { .array = data_array, .used = 0, .size = 1 }; + f_directory_statuss_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_statusss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_statusss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0] = datas; + datas_array[0].array[0].path = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -31,7 +36,7 @@ void test__f_directory_statusss_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_directory_statusss_destroy_callback(0, 1, (void *) datass_array); + const f_status_t status = f_directory_statusss_destroy_callback(0, 1, (void *) datas_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_directory/tests/unit/c/test-directory.c b/level_0/f_directory/tests/unit/c/test-directory.c index 7b992e9..1a06c74 100644 --- a/level_0/f_directory/tests/unit/c/test-directory.c +++ b/level_0/f_directory/tests/unit/c/test-directory.c @@ -68,35 +68,35 @@ int main(void) { cmocka_unit_test(test__f_directory_remove_custom__returns_data_not), cmocka_unit_test(test__f_directory_remove_custom__works), - cmocka_unit_test(test__f_directory_listings_destroy_callback__fails), cmocka_unit_test(test__f_directory_listings_delete_callback__fails), - cmocka_unit_test(test__f_directory_listingss_destroy_callback__fails), + cmocka_unit_test(test__f_directory_listings_destroy_callback__fails), cmocka_unit_test(test__f_directory_listingss_delete_callback__fails), + cmocka_unit_test(test__f_directory_listingss_destroy_callback__fails), - cmocka_unit_test(test__f_directory_listings_destroy_callback__works), cmocka_unit_test(test__f_directory_listings_delete_callback__works), - cmocka_unit_test(test__f_directory_listingss_destroy_callback__works), + cmocka_unit_test(test__f_directory_listings_destroy_callback__works), cmocka_unit_test(test__f_directory_listingss_delete_callback__works), + cmocka_unit_test(test__f_directory_listingss_destroy_callback__works), - cmocka_unit_test(test__f_directory_recurse_dos_destroy_callback__fails), cmocka_unit_test(test__f_directory_recurse_dos_delete_callback__fails), - cmocka_unit_test(test__f_directory_recurse_doss_destroy_callback__fails), + cmocka_unit_test(test__f_directory_recurse_dos_destroy_callback__fails), cmocka_unit_test(test__f_directory_recurse_doss_delete_callback__fails), + cmocka_unit_test(test__f_directory_recurse_doss_destroy_callback__fails), - cmocka_unit_test(test__f_directory_recurse_dos_destroy_callback__works), cmocka_unit_test(test__f_directory_recurse_dos_delete_callback__works), - cmocka_unit_test(test__f_directory_recurse_doss_destroy_callback__works), + cmocka_unit_test(test__f_directory_recurse_dos_destroy_callback__works), cmocka_unit_test(test__f_directory_recurse_doss_delete_callback__works), + cmocka_unit_test(test__f_directory_recurse_doss_destroy_callback__works), - cmocka_unit_test(test__f_directory_statuss_destroy_callback__fails), cmocka_unit_test(test__f_directory_statuss_delete_callback__fails), - cmocka_unit_test(test__f_directory_statusss_destroy_callback__fails), + cmocka_unit_test(test__f_directory_statuss_destroy_callback__fails), cmocka_unit_test(test__f_directory_statusss_delete_callback__fails), + cmocka_unit_test(test__f_directory_statusss_destroy_callback__fails), - cmocka_unit_test(test__f_directory_statuss_destroy_callback__works), cmocka_unit_test(test__f_directory_statuss_delete_callback__works), - cmocka_unit_test(test__f_directory_statusss_destroy_callback__works), + cmocka_unit_test(test__f_directory_statuss_destroy_callback__works), cmocka_unit_test(test__f_directory_statusss_delete_callback__works), + cmocka_unit_test(test__f_directory_statusss_destroy_callback__works), cmocka_unit_test(test__f_directory_touch__fails), cmocka_unit_test(test__f_directory_touch__returns_data_not), @@ -121,18 +121,18 @@ int main(void) { // f_directory_touch() doesn't use parameter checking. // f_directory_touch_at() doesn't use parameter checking. - // f_directory_listings_destroy_callback() doesn't use parameter checking. // f_directory_listings_delete_callback() doesn't use parameter checking. - // f_directory_listingss_destroy_callback() doesn't use parameter checking. + // f_directory_listings_destroy_callback() doesn't use parameter checking. // f_directory_listingss_delete_callback() doesn't use parameter checking. - // f_directory_recurse_dos_destroy_callback() doesn't use parameter checking. + // f_directory_listingss_destroy_callback() doesn't use parameter checking. // f_directory_recurse_dos_delete_callback() doesn't use parameter checking. - // f_directory_recurse_doss_destroy_callback() doesn't use parameter checking. + // f_directory_recurse_dos_destroy_callback() doesn't use parameter checking. // f_directory_recurse_doss_delete_callback() doesn't use parameter checking. - // f_directory_statuss_destroy_callback() doesn't use parameter checking. + // f_directory_recurse_doss_destroy_callback() doesn't use parameter checking. // f_directory_statuss_delete_callback() doesn't use parameter checking. - // f_directory_statusss_destroy_callback() doesn't use parameter checking. + // f_directory_statuss_destroy_callback() doesn't use parameter checking. // f_directory_statusss_delete_callback() doesn't use parameter checking. + // f_directory_statusss_destroy_callback() doesn't use parameter checking. #endif // _di_level_0_parameter_checking_ }; diff --git a/level_0/f_directory/tests/unit/c/test-directory.h b/level_0/f_directory/tests/unit/c/test-directory.h index 6bedc79..fef2ff4 100644 --- a/level_0/f_directory/tests/unit/c/test-directory.h +++ b/level_0/f_directory/tests/unit/c/test-directory.h @@ -37,18 +37,18 @@ #include "test-directory-open_at.h" #include "test-directory-remove.h" #include "test-directory-remove_custom.h" -#include "test-directory-listings_destroy_callback.h" #include "test-directory-listings_delete_callback.h" -#include "test-directory-listingss_destroy_callback.h" +#include "test-directory-listings_destroy_callback.h" #include "test-directory-listingss_delete_callback.h" -#include "test-directory-recurse_dos_destroy_callback.h" +#include "test-directory-listingss_destroy_callback.h" #include "test-directory-recurse_dos_delete_callback.h" -#include "test-directory-recurse_doss_destroy_callback.h" +#include "test-directory-recurse_dos_destroy_callback.h" #include "test-directory-recurse_doss_delete_callback.h" -#include "test-directory-statuss_destroy_callback.h" +#include "test-directory-recurse_doss_destroy_callback.h" #include "test-directory-statuss_delete_callback.h" -#include "test-directory-statusss_destroy_callback.h" +#include "test-directory-statuss_destroy_callback.h" #include "test-directory-statusss_delete_callback.h" +#include "test-directory-statusss_destroy_callback.h" #include "test-directory-touch.h" #include "test-directory-touch_at.h" diff --git a/level_0/f_fss/tests/unit/c/test-fss-items_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-items_delete_callback.c index 7d64b62..2f81e49 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-items_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-items_delete_callback.c @@ -10,16 +10,18 @@ void test__f_fss_items_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_item_t data = f_fss_item_t_initialize; + f_string_range_t base = macro_f_string_range_t_initialize_1(1, 0); + f_string_range_t base_array[] = { base }; + f_string_ranges_t bases = { .array = base_array, .used = 0, .size = 1 }; + + f_fss_item_t data = { .content = bases }; f_fss_item_t data_array[] = { data }; - f_fss_items_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_fss_items_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_fss_items_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_items_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-items_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-items_destroy_callback.c index f77b19e..220eda1 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-items_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-items_destroy_callback.c @@ -10,16 +10,18 @@ void test__f_fss_items_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_item_t data = f_fss_item_t_initialize; + f_string_range_t base = macro_f_string_range_t_initialize_1(1, 0); + f_string_range_t base_array[] = { base }; + f_string_ranges_t bases = { .array = base_array, .used = 0, .size = 1 }; + + f_fss_item_t data = { .content = bases }; f_fss_item_t data_array[] = { data }; - f_fss_items_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_fss_items_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_fss_items_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_items_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-itemss_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-itemss_delete_callback.c index 10fb65a..3e06f00 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-itemss_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-itemss_delete_callback.c @@ -10,9 +10,13 @@ void test__f_fss_itemss_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_item_t data = f_fss_item_t_initialize; + f_string_range_t base = macro_f_string_range_t_initialize_1(1, 0); + f_string_range_t base_array[] = { base }; + f_string_ranges_t bases = { .array = base_array, .used = 0, .size = 1 }; + + f_fss_item_t data = { .content = bases }; f_fss_item_t data_array[] = { data }; - f_fss_items_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_items_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_items_t datas_array[] = { datas }; { @@ -24,6 +28,10 @@ void test__f_fss_itemss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].content.size = 1; + datas_array[0].array[0].content.array[0] = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-itemss_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-itemss_destroy_callback.c index 18e875c..dbbcebf 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-itemss_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-itemss_destroy_callback.c @@ -10,9 +10,13 @@ void test__f_fss_itemss_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_item_t data = f_fss_item_t_initialize; + f_string_range_t base = macro_f_string_range_t_initialize_1(1, 0); + f_string_range_t base_array[] = { base }; + f_string_ranges_t bases = { .array = base_array, .used = 0, .size = 1 }; + + f_fss_item_t data = { .content = bases }; f_fss_item_t data_array[] = { data }; - f_fss_items_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_items_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_items_t datas_array[] = { datas }; { @@ -24,6 +28,10 @@ void test__f_fss_itemss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].content.size = 1; + datas_array[0].array[0].content.array[0] = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-named_delete.c b/level_0/f_fss/tests/unit/c/test-fss-named_delete.c index f7fb371..b7c8a9d 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-named_delete.c +++ b/level_0/f_fss/tests/unit/c/test-fss-named_delete.c @@ -10,7 +10,18 @@ void test__f_fss_named_delete__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_named_t data = f_fss_named_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_named_t data = { .objects = objects, .contents = contents, .quotess = quotess }; { will_return(__wrap_f_memory_array_resize, true); @@ -21,6 +32,10 @@ void test__f_fss_named_delete__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data.objects = objects; + data.contents = contents; + data.quotess = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -33,6 +48,10 @@ void test__f_fss_named_delete__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data.objects = objects; + data.contents = contents; + data.quotess = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-named_destroy.c b/level_0/f_fss/tests/unit/c/test-fss-named_destroy.c index acf4482..bdee6d7 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-named_destroy.c +++ b/level_0/f_fss/tests/unit/c/test-fss-named_destroy.c @@ -10,7 +10,18 @@ void test__f_fss_named_destroy__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_named_t data = f_fss_named_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_named_t data = { .objects = objects, .contents = contents, .quotess = quotess }; { will_return(__wrap_f_memory_array_adjust, true); @@ -21,6 +32,10 @@ void test__f_fss_named_destroy__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data.objects = objects; + data.contents = contents; + data.quotess = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -33,6 +48,10 @@ void test__f_fss_named_destroy__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data.objects = objects; + data.contents = contents; + data.quotess = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-nameds_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-nameds_delete_callback.c index e02d1e4..d45261e 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-nameds_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-nameds_delete_callback.c @@ -10,20 +10,33 @@ void test__f_fss_nameds_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_named_t data = f_fss_named_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_named_t data = { .objects = objects, .contents = contents, .quotess = quotess }; f_fss_named_t data_array[] = { data }; - f_fss_nameds_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_fss_nameds_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_fss_nameds_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_nameds_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + data_array[0].quotess = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -31,11 +44,15 @@ void test__f_fss_nameds_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_fss_nameds_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_nameds_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + data_array[0].quotess = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -46,7 +63,7 @@ void test__f_fss_nameds_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_fss_nameds_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_nameds_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-nameds_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-nameds_destroy_callback.c index 850d39b..93540f8 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-nameds_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-nameds_destroy_callback.c @@ -10,20 +10,33 @@ void test__f_fss_nameds_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_named_t data = f_fss_named_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_named_t data = { .objects = objects, .contents = contents, .quotess = quotess }; f_fss_named_t data_array[] = { data }; - f_fss_nameds_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_fss_nameds_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_fss_nameds_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_nameds_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + data_array[0].quotess = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -31,11 +44,15 @@ void test__f_fss_nameds_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_fss_nameds_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_nameds_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + data_array[0].quotess = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -46,7 +63,7 @@ void test__f_fss_nameds_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_fss_nameds_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_nameds_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-namedss_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-namedss_delete_callback.c index ae19edd..001eede 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-namedss_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-namedss_delete_callback.c @@ -10,9 +10,20 @@ void test__f_fss_namedss_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_named_t data = f_fss_named_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_named_t data = { .objects = objects, .contents = contents, .quotess = quotess }; f_fss_named_t data_array[] = { data }; - f_fss_nameds_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_nameds_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_nameds_t datas_array[] = { datas }; { @@ -24,6 +35,11 @@ void test__f_fss_namedss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + datas_array[0].array[0].quotess = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -36,6 +52,11 @@ void test__f_fss_namedss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + datas_array[0].array[0].quotess = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-namedss_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-namedss_destroy_callback.c index 2cdfe6e..ba993ea 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-namedss_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-namedss_destroy_callback.c @@ -10,9 +10,20 @@ void test__f_fss_namedss_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_named_t data = f_fss_named_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_named_t data = { .objects = objects, .contents = contents, .quotess = quotess }; f_fss_named_t data_array[] = { data }; - f_fss_nameds_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_nameds_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_nameds_t datas_array[] = { datas }; { @@ -24,6 +35,11 @@ void test__f_fss_namedss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + datas_array[0].array[0].quotess = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -36,6 +52,11 @@ void test__f_fss_namedss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + datas_array[0].array[0].quotess = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-nests_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-nests_delete_callback.c index e607e09..03dcae3 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-nests_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-nests_delete_callback.c @@ -10,11 +10,16 @@ void test__f_fss_nests_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_item_t item = f_fss_item_t_initialize; + f_string_range_t base = macro_f_string_range_t_initialize_1(1, 0); + f_string_range_t base_array[] = { base }; + f_string_ranges_t bases = { .array = base_array, .used = 0, .size = 1 }; + + f_fss_item_t item = { .content = bases }; f_fss_item_t item_array[] = { item }; - f_fss_items_t items = { .array = item_array, .used = 1, .size = 1 }; + f_fss_items_t items = { .array = item_array, .used = 0, .size = 1 }; f_fss_items_t items_array[] = { items }; - f_fss_nest_t data = { .depth = items_array, .used = 1, .size = 1 }; + + f_fss_nest_t data = { .depth = items_array, .used = 0, .size = 1 }; f_fss_nest_t data_array[] = { data }; { @@ -26,6 +31,10 @@ void test__f_fss_nests_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].size = 1; + data_array[0].depth[0].size = 1; + data_array[0].depth[0].array[0].content = bases; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -38,6 +47,10 @@ void test__f_fss_nests_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].size = 1; + data_array[0].depth[0].size = 1; + data_array[0].depth[0].array[0].content = bases; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-nests_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-nests_destroy_callback.c index abb2a20..edf3c92 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-nests_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-nests_destroy_callback.c @@ -10,11 +10,16 @@ void test__f_fss_nests_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_item_t item = f_fss_item_t_initialize; + f_string_range_t base = macro_f_string_range_t_initialize_1(1, 0); + f_string_range_t base_array[] = { base }; + f_string_ranges_t bases = { .array = base_array, .used = 0, .size = 1 }; + + f_fss_item_t item = { .content = bases }; f_fss_item_t item_array[] = { item }; - f_fss_items_t items = { .array = item_array, .used = 1, .size = 1 }; + f_fss_items_t items = { .array = item_array, .used = 0, .size = 1 }; f_fss_items_t items_array[] = { items }; - f_fss_nest_t data = { .depth = items_array, .used = 1, .size = 1 }; + + f_fss_nest_t data = { .depth = items_array, .used = 0, .size = 1 }; f_fss_nest_t data_array[] = { data }; { @@ -26,6 +31,10 @@ void test__f_fss_nests_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].size = 1; + data_array[0].depth[0].size = 1; + data_array[0].depth[0].array[0].content = bases; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -38,6 +47,10 @@ void test__f_fss_nests_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].size = 1; + data_array[0].depth[0].size = 1; + data_array[0].depth[0].array[0].content = bases; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-nestss_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-nestss_delete_callback.c index 00cc2c8..8367776 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-nestss_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-nestss_delete_callback.c @@ -16,7 +16,7 @@ void test__f_fss_nestss_delete_callback__fails(void **state) { f_fss_items_t items_array[] = { items }; f_fss_nest_t data = { .depth = items_array, .used = 1, .size = 1 }; f_fss_nest_t data_array[] = { data }; - f_fss_nests_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_nests_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_nests_t datas_array[] = { datas }; { diff --git a/level_0/f_fss/tests/unit/c/test-fss-nestss_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-nestss_destroy_callback.c index a697364..e5ea694 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-nestss_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-nestss_destroy_callback.c @@ -16,7 +16,7 @@ void test__f_fss_nestss_destroy_callback__fails(void **state) { f_fss_items_t items_array[] = { items }; f_fss_nest_t data = { .depth = items_array, .used = 1, .size = 1 }; f_fss_nest_t data_array[] = { data }; - f_fss_nests_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_nests_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_nests_t datas_array[] = { datas }; { diff --git a/level_0/f_fss/tests/unit/c/test-fss-set_delete.c b/level_0/f_fss/tests/unit/c/test-fss-set_delete.c index 4551fb9..9eba7dd 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-set_delete.c +++ b/level_0/f_fss/tests/unit/c/test-fss-set_delete.c @@ -10,7 +10,13 @@ void test__f_fss_set_delete__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_t data = f_fss_set_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + f_fss_set_t data = { .objects = objects, .contents = contents }; { will_return(__wrap_f_memory_array_resize, true); diff --git a/level_0/f_fss/tests/unit/c/test-fss-set_destroy.c b/level_0/f_fss/tests/unit/c/test-fss-set_destroy.c index ac81e29..e4cc5b6 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-set_destroy.c +++ b/level_0/f_fss/tests/unit/c/test-fss-set_destroy.c @@ -10,7 +10,13 @@ void test__f_fss_set_destroy__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_t data = f_fss_set_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + f_fss_set_t data = { .objects = objects, .contents = contents }; { will_return(__wrap_f_memory_array_adjust, true); diff --git a/level_0/f_fss/tests/unit/c/test-fss-set_quote_delete.c b/level_0/f_fss/tests/unit/c/test-fss-set_quote_delete.c index 6499923..6076729 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-set_quote_delete.c +++ b/level_0/f_fss/tests/unit/c/test-fss-set_quote_delete.c @@ -10,7 +10,18 @@ void test__f_fss_set_quote_delete__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_quote_t data = f_fss_set_quote_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_set_quote_t data = { .objects = objects, .contents = contents, .objects_quote = quotes, .contents_quote = quotess }; { will_return(__wrap_f_memory_array_resize, true); diff --git a/level_0/f_fss/tests/unit/c/test-fss-set_quote_destroy.c b/level_0/f_fss/tests/unit/c/test-fss-set_quote_destroy.c index 837833e..ecc527e 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-set_quote_destroy.c +++ b/level_0/f_fss/tests/unit/c/test-fss-set_quote_destroy.c @@ -10,7 +10,18 @@ void test__f_fss_set_quote_destroy__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_quote_t data = f_fss_set_quote_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_set_quote_t data = { .objects = objects, .contents = contents, .objects_quote = quotes, .contents_quote = quotess }; { will_return(__wrap_f_memory_array_adjust, true); diff --git a/level_0/f_fss/tests/unit/c/test-fss-set_quotes_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-set_quotes_delete_callback.c index 270952d..ddc8f39 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-set_quotes_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-set_quotes_delete_callback.c @@ -10,20 +10,34 @@ void test__f_fss_set_quotes_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_quote_t data = f_fss_set_quote_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_set_quote_t data = { .objects = objects, .contents = contents, .objects_quote = quotes, .contents_quote = quotess }; f_fss_set_quote_t data_array[] = { data }; - f_fss_set_quotes_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_fss_set_quotes_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_fss_set_quotes_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_set_quotes_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + data_array[0].objects_quote = quotes; + data_array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -31,11 +45,16 @@ void test__f_fss_set_quotes_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_fss_set_quotes_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_set_quotes_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + data_array[0].objects_quote = quotes; + data_array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -46,11 +65,16 @@ void test__f_fss_set_quotes_delete_callback__fails(void **state) { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_fss_set_quotes_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_set_quotes_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + data_array[0].objects_quote = quotes; + data_array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -64,7 +88,7 @@ void test__f_fss_set_quotes_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_fss_set_quotes_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_set_quotes_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-set_quotes_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-set_quotes_destroy_callback.c index 2ebf3af..2714a67 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-set_quotes_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-set_quotes_destroy_callback.c @@ -10,20 +10,34 @@ void test__f_fss_set_quotes_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_quote_t data = f_fss_set_quote_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_set_quote_t data = { .objects = objects, .contents = contents, .objects_quote = quotes, .contents_quote = quotess }; f_fss_set_quote_t data_array[] = { data }; - f_fss_set_quotes_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_fss_set_quotes_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_fss_set_quotes_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_set_quotes_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + data_array[0].objects_quote = quotes; + data_array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -31,11 +45,16 @@ void test__f_fss_set_quotes_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_fss_set_quotes_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_set_quotes_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + data_array[0].objects_quote = quotes; + data_array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -46,11 +65,16 @@ void test__f_fss_set_quotes_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_fss_set_quotes_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_set_quotes_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + data_array[0].objects_quote = quotes; + data_array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -64,7 +88,7 @@ void test__f_fss_set_quotes_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_fss_set_quotes_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_set_quotes_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-set_quotess_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-set_quotess_delete_callback.c index 6458115..6e114a1 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-set_quotess_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-set_quotess_delete_callback.c @@ -10,9 +10,20 @@ void test__f_fss_set_quotess_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_quote_t data = f_fss_set_quote_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_set_quote_t data = { .objects = objects, .contents = contents, .objects_quote = quotes, .contents_quote = quotess }; f_fss_set_quote_t data_array[] = { data }; - f_fss_set_quotes_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_set_quotes_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_set_quotes_t datas_array[] = { datas }; { @@ -24,6 +35,12 @@ void test__f_fss_set_quotess_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + datas_array[0].array[0].objects_quote = quotes; + datas_array[0].array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -36,6 +53,12 @@ void test__f_fss_set_quotess_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + datas_array[0].array[0].objects_quote = quotes; + datas_array[0].array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -51,6 +74,12 @@ void test__f_fss_set_quotess_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + datas_array[0].array[0].objects_quote = quotes; + datas_array[0].array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-set_quotess_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-set_quotess_destroy_callback.c index c41c208..a866bf4 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-set_quotess_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-set_quotess_destroy_callback.c @@ -10,9 +10,20 @@ void test__f_fss_set_quotess_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_quote_t data = f_fss_set_quote_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + uint8_t quote_array[] = { 0 }; + f_uint8s_t quotes = { .array = quote_array, .used = 0, .size = 1 }; + f_uint8s_t quotes_array[] = { quotes }; + f_uint8ss_t quotess = { .array = quotes_array, .used = 0, .size = 1 };; + + f_fss_set_quote_t data = { .objects = objects, .contents = contents, .objects_quote = quotes, .contents_quote = quotess }; f_fss_set_quote_t data_array[] = { data }; - f_fss_set_quotes_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_set_quotes_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_set_quotes_t datas_array[] = { datas }; { @@ -24,6 +35,12 @@ void test__f_fss_set_quotess_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + datas_array[0].array[0].objects_quote = quotes; + datas_array[0].array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -36,6 +53,12 @@ void test__f_fss_set_quotess_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + datas_array[0].array[0].objects_quote = quotes; + datas_array[0].array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -51,6 +74,12 @@ void test__f_fss_set_quotess_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + datas_array[0].array[0].objects_quote = quotes; + datas_array[0].array[0].contents_quote = quotess; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-sets_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-sets_delete_callback.c index d1e980c..d5f306d 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-sets_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-sets_delete_callback.c @@ -10,20 +10,27 @@ void test__f_fss_sets_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_t data = f_fss_set_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + f_fss_set_t data = { .objects = objects, .contents = contents }; f_fss_set_t data_array[] = { data }; - f_fss_sets_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_fss_sets_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_fss_sets_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_sets_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -31,7 +38,7 @@ void test__f_fss_sets_delete_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_resize, true); will_return(__wrap_f_memory_arrays_resize, F_status_set_error(F_failure)); - const f_status_t status = f_fss_sets_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_sets_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-sets_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-sets_destroy_callback.c index 3714d05..1e0a846 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-sets_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-sets_destroy_callback.c @@ -10,20 +10,27 @@ void test__f_fss_sets_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_t data = f_fss_set_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + f_fss_set_t data = { .objects = objects, .contents = contents }; f_fss_set_t data_array[] = { data }; - f_fss_sets_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_fss_sets_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_fss_sets_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_sets_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].objects = objects; + data_array[0].contents = contents; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -31,7 +38,7 @@ void test__f_fss_sets_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_arrays_adjust, true); will_return(__wrap_f_memory_arrays_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_fss_sets_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_sets_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-setss_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-setss_delete_callback.c index d724826..28d6150 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-setss_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-setss_delete_callback.c @@ -10,9 +10,15 @@ void test__f_fss_setss_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_t data = f_fss_set_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + f_fss_set_t data = { .objects = objects, .contents = contents }; f_fss_set_t data_array[] = { data }; - f_fss_sets_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_sets_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_sets_t datas_array[] = { datas }; { @@ -24,6 +30,10 @@ void test__f_fss_setss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-setss_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-setss_destroy_callback.c index 57ec057..88edcb7 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-setss_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-setss_destroy_callback.c @@ -10,9 +10,15 @@ void test__f_fss_setss_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_set_t data = f_fss_set_t_initialize; + f_string_range_t base = f_string_range_t_initialize; + f_string_range_t base_array[] = { base }; + f_string_ranges_t objects = { .array = base_array, .used = 0, .size = 1 }; + f_string_ranges_t objects_array[] = { objects }; + f_string_rangess_t contents = { .array = objects_array, .used = 0, .size = 1 }; + + f_fss_set_t data = { .objects = objects, .contents = contents }; f_fss_set_t data_array[] = { data }; - f_fss_sets_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_sets_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_sets_t datas_array[] = { datas }; { @@ -24,6 +30,10 @@ void test__f_fss_setss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].objects = objects; + datas_array[0].array[0].contents = contents; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-simple_packet_delete.c b/level_0/f_fss/tests/unit/c/test-fss-simple_packet_delete.c index ce8cc93..a424bea 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-simple_packet_delete.c +++ b/level_0/f_fss/tests/unit/c/test-fss-simple_packet_delete.c @@ -10,7 +10,9 @@ void test__f_fss_simple_packet_delete__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_simple_packet_t data = f_fss_simple_packet_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_fss_simple_packet_t data = { .payload = base }; { will_return(__wrap_f_memory_array_resize, true); diff --git a/level_0/f_fss/tests/unit/c/test-fss-simple_packet_destroy.c b/level_0/f_fss/tests/unit/c/test-fss-simple_packet_destroy.c index 54e39da..18c02ae 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-simple_packet_destroy.c +++ b/level_0/f_fss/tests/unit/c/test-fss-simple_packet_destroy.c @@ -10,7 +10,9 @@ void test__f_fss_simple_packet_destroy__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_simple_packet_t data = f_fss_simple_packet_t_initialize; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_fss_simple_packet_t data = { .payload = base }; { will_return(__wrap_f_memory_array_adjust, true); diff --git a/level_0/f_fss/tests/unit/c/test-fss-simple_packets_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-simple_packets_delete_callback.c index 378f903..18b4822 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-simple_packets_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-simple_packets_delete_callback.c @@ -10,16 +10,16 @@ void test__f_fss_simple_packets_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_simple_packet_t data = { .payload = f_string_empty_s, .control = 0, .size = 0 }; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_fss_simple_packet_t data = { .payload = base }; f_fss_simple_packet_t data_array[] = { data }; - f_fss_simple_packets_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_fss_simple_packets_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_fss_simple_packets_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_simple_packets_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-simple_packets_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-simple_packets_destroy_callback.c index f8db961..fb8e78d 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-simple_packets_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-simple_packets_destroy_callback.c @@ -10,16 +10,16 @@ void test__f_fss_simple_packets_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_simple_packet_t data = { .payload = f_string_empty_s, .control = 0, .size = 0 }; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_fss_simple_packet_t data = { .payload = base }; f_fss_simple_packet_t data_array[] = { data }; - f_fss_simple_packets_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_fss_simple_packets_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_fss_simple_packets_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_fss_simple_packets_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_fss/tests/unit/c/test-fss-simple_packetss_delete_callback.c b/level_0/f_fss/tests/unit/c/test-fss-simple_packetss_delete_callback.c index 173b366..1c46e56 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-simple_packetss_delete_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-simple_packetss_delete_callback.c @@ -10,9 +10,11 @@ void test__f_fss_simple_packetss_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_simple_packet_t data = { .payload = f_string_empty_s, .control = 0, .size = 0 }; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_fss_simple_packet_t data = { .payload = base }; f_fss_simple_packet_t data_array[] = { data }; - f_fss_simple_packets_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_simple_packets_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_simple_packets_t datas_array[] = { datas }; { @@ -24,6 +26,9 @@ void test__f_fss_simple_packetss_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].payload = base; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); diff --git a/level_0/f_fss/tests/unit/c/test-fss-simple_packetss_destroy_callback.c b/level_0/f_fss/tests/unit/c/test-fss-simple_packetss_destroy_callback.c index f0d343a..69b5367 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-simple_packetss_destroy_callback.c +++ b/level_0/f_fss/tests/unit/c/test-fss-simple_packetss_destroy_callback.c @@ -10,9 +10,11 @@ void test__f_fss_simple_packetss_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_fss_simple_packet_t data = { .payload = f_string_empty_s, .control = 0, .size = 0 }; + f_string_static_t base = macro_f_string_static_t_initialize_1(F_string_empty_s, 1, 0); + + f_fss_simple_packet_t data = { .payload = base }; f_fss_simple_packet_t data_array[] = { data }; - f_fss_simple_packets_t datas = { .array = data_array, .used = 1, .size = 1 }; + f_fss_simple_packets_t datas = { .array = data_array, .used = 0, .size = 1 }; f_fss_simple_packets_t datas_array[] = { datas }; { @@ -24,6 +26,9 @@ void test__f_fss_simple_packetss_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].payload = base; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); diff --git a/level_0/f_iki/tests/unit/c/test-iki-datas_delete_callback.c b/level_0/f_iki/tests/unit/c/test-iki-datas_delete_callback.c index 89ba1fc..1b55bba 100644 --- a/level_0/f_iki/tests/unit/c/test-iki-datas_delete_callback.c +++ b/level_0/f_iki/tests/unit/c/test-iki-datas_delete_callback.c @@ -10,24 +10,33 @@ void test__f_iki_datas_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_string_ranges_t content = f_string_ranges_t_initialize; - f_number_unsigneds_t delimits = f_number_unsigneds_t_initialize; - f_string_ranges_t variable = f_string_ranges_t_initialize; - f_string_ranges_t vocabulary = f_string_ranges_t_initialize; + f_string_range_t base = macro_f_string_range_t_initialize_1(1, 0); + f_string_range_t base_array[] = { base }; + f_string_ranges_t bases = { .array = base_array, .used = 0, .size = 1 }; + + f_string_ranges_t content = bases; + f_number_unsigned_t delimit_array[] = { 0 }; + f_number_unsigneds_t delimits = { .array = delimit_array, .used = 0, .size = 1 }; + f_string_ranges_t variable = bases; + f_string_ranges_t vocabulary = bases; + f_iki_data_t data = { .content = content, .delimits = delimits, .variable = variable, .vocabulary = vocabulary }; f_iki_data_t data_array[] = { data }; - f_iki_datas_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_iki_datas_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_iki_datas_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_iki_datas_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].content = content; + data_array[0].delimits = delimits; + data_array[0].variable = variable; + data_array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -35,11 +44,16 @@ void test__f_iki_datas_delete_callback__fails(void **state) { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_iki_datas_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_iki_datas_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].content = content; + data_array[0].delimits = delimits; + data_array[0].variable = variable; + data_array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -50,11 +64,16 @@ void test__f_iki_datas_delete_callback__fails(void **state) { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_iki_datas_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_iki_datas_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].content = content; + data_array[0].delimits = delimits; + data_array[0].variable = variable; + data_array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -68,7 +87,7 @@ void test__f_iki_datas_delete_callback__fails(void **state) { will_return(__wrap_f_memory_array_resize, true); will_return(__wrap_f_memory_array_resize, F_status_set_error(F_failure)); - const f_status_t status = f_iki_datas_delete_callback(0, 1, (void *) datas_array); + const f_status_t status = f_iki_datas_delete_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_iki/tests/unit/c/test-iki-datas_destroy_callback.c b/level_0/f_iki/tests/unit/c/test-iki-datas_destroy_callback.c index fc7c467..5a1bd56 100644 --- a/level_0/f_iki/tests/unit/c/test-iki-datas_destroy_callback.c +++ b/level_0/f_iki/tests/unit/c/test-iki-datas_destroy_callback.c @@ -10,24 +10,33 @@ void test__f_iki_datas_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_string_ranges_t content = f_string_ranges_t_initialize; - f_number_unsigneds_t delimits = f_number_unsigneds_t_initialize; - f_string_ranges_t variable = f_string_ranges_t_initialize; - f_string_ranges_t vocabulary = f_string_ranges_t_initialize; + f_string_range_t base = macro_f_string_range_t_initialize_1(1, 0); + f_string_range_t base_array[] = { base }; + f_string_ranges_t bases = { .array = base_array, .used = 0, .size = 1 }; + + f_string_ranges_t content = bases; + f_number_unsigned_t delimit_array[] = { 0 }; + f_number_unsigneds_t delimits = { .array = delimit_array, .used = 0, .size = 1 }; + f_string_ranges_t variable = bases; + f_string_ranges_t vocabulary = bases; + f_iki_data_t data = { .content = content, .delimits = delimits, .variable = variable, .vocabulary = vocabulary }; f_iki_data_t data_array[] = { data }; - f_iki_datas_t datas = { .array = data_array, .used = 1, .size = 1 }; - f_iki_datas_t datas_array[] = { datas }; { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_iki_datas_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_iki_datas_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].content = content; + data_array[0].delimits = delimits; + data_array[0].variable = variable; + data_array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -35,11 +44,16 @@ void test__f_iki_datas_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_iki_datas_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_iki_datas_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].content = content; + data_array[0].delimits = delimits; + data_array[0].variable = variable; + data_array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -50,11 +64,16 @@ void test__f_iki_datas_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_iki_datas_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_iki_datas_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } + data_array[0].content = content; + data_array[0].delimits = delimits; + data_array[0].variable = variable; + data_array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -68,7 +87,7 @@ void test__f_iki_datas_destroy_callback__fails(void **state) { will_return(__wrap_f_memory_array_adjust, true); will_return(__wrap_f_memory_array_adjust, F_status_set_error(F_failure)); - const f_status_t status = f_iki_datas_destroy_callback(0, 1, (void *) datas_array); + const f_status_t status = f_iki_datas_destroy_callback(0, 1, (void *) data_array); assert_int_equal(status, F_status_set_error(F_failure)); } diff --git a/level_0/f_iki/tests/unit/c/test-iki-datass_delete_callback.c b/level_0/f_iki/tests/unit/c/test-iki-datass_delete_callback.c index 742631a..6bd0cde 100644 --- a/level_0/f_iki/tests/unit/c/test-iki-datass_delete_callback.c +++ b/level_0/f_iki/tests/unit/c/test-iki-datass_delete_callback.c @@ -10,10 +10,16 @@ void test__f_iki_datass_delete_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_string_ranges_t content = f_string_ranges_t_initialize; - f_number_unsigneds_t delimits = f_number_unsigneds_t_initialize; - f_string_ranges_t variable = f_string_ranges_t_initialize; - f_string_ranges_t vocabulary = f_string_ranges_t_initialize; + f_string_range_t base = macro_f_string_range_t_initialize_1(1, 0); + f_string_range_t base_array[] = { base }; + f_string_ranges_t bases = { .array = base_array, .used = 0, .size = 1 }; + + f_string_ranges_t content = bases; + f_number_unsigned_t delimit_array[] = { 0 }; + f_number_unsigneds_t delimits = { .array = delimit_array, .used = 0, .size = 1 }; + f_string_ranges_t variable = bases; + f_string_ranges_t vocabulary = bases; + f_iki_data_t data = { .content = content, .delimits = delimits, .variable = variable, .vocabulary = vocabulary }; f_iki_data_t data_array[] = { data }; f_iki_datas_t datas = { .array = data_array, .used = 1, .size = 1 }; @@ -28,6 +34,12 @@ void test__f_iki_datass_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].content = content; + datas_array[0].array[0].delimits = delimits; + datas_array[0].array[0].variable = variable; + datas_array[0].array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -40,6 +52,12 @@ void test__f_iki_datass_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].content = content; + datas_array[0].array[0].delimits = delimits; + datas_array[0].array[0].variable = variable; + datas_array[0].array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -55,6 +73,12 @@ void test__f_iki_datass_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].content = content; + datas_array[0].array[0].delimits = delimits; + datas_array[0].array[0].variable = variable; + datas_array[0].array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); @@ -73,6 +97,12 @@ void test__f_iki_datass_delete_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].content = content; + datas_array[0].array[0].delimits = delimits; + datas_array[0].array[0].variable = variable; + datas_array[0].array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_resize, false); will_return(__wrap_f_memory_array_resize, F_okay); diff --git a/level_0/f_iki/tests/unit/c/test-iki-datass_destroy_callback.c b/level_0/f_iki/tests/unit/c/test-iki-datass_destroy_callback.c index 9e705ab..8422b7f 100644 --- a/level_0/f_iki/tests/unit/c/test-iki-datass_destroy_callback.c +++ b/level_0/f_iki/tests/unit/c/test-iki-datass_destroy_callback.c @@ -10,10 +10,16 @@ void test__f_iki_datass_destroy_callback__fails(void **state) { mock_unwrap = 0; mock_unwrap_f_memory = 0; - f_string_ranges_t content = f_string_ranges_t_initialize; - f_number_unsigneds_t delimits = f_number_unsigneds_t_initialize; - f_string_ranges_t variable = f_string_ranges_t_initialize; - f_string_ranges_t vocabulary = f_string_ranges_t_initialize; + f_string_range_t base = macro_f_string_range_t_initialize_1(1, 0); + f_string_range_t base_array[] = { base }; + f_string_ranges_t bases = { .array = base_array, .used = 0, .size = 1 }; + + f_string_ranges_t content = bases; + f_number_unsigned_t delimit_array[] = { 0 }; + f_number_unsigneds_t delimits = { .array = delimit_array, .used = 0, .size = 1 }; + f_string_ranges_t variable = bases; + f_string_ranges_t vocabulary = bases; + f_iki_data_t data = { .content = content, .delimits = delimits, .variable = variable, .vocabulary = vocabulary }; f_iki_data_t data_array[] = { data }; f_iki_datas_t datas = { .array = data_array, .used = 1, .size = 1 }; @@ -28,6 +34,12 @@ void test__f_iki_datass_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].content = content; + datas_array[0].array[0].delimits = delimits; + datas_array[0].array[0].variable = variable; + datas_array[0].array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -40,6 +52,12 @@ void test__f_iki_datass_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].content = content; + datas_array[0].array[0].delimits = delimits; + datas_array[0].array[0].variable = variable; + datas_array[0].array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -55,6 +73,12 @@ void test__f_iki_datass_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].content = content; + datas_array[0].array[0].delimits = delimits; + datas_array[0].array[0].variable = variable; + datas_array[0].array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); @@ -73,6 +97,12 @@ void test__f_iki_datass_destroy_callback__fails(void **state) { assert_int_equal(status, F_status_set_error(F_failure)); } + datas_array[0].size = 1; + datas_array[0].array[0].content = content; + datas_array[0].array[0].delimits = delimits; + datas_array[0].array[0].variable = variable; + datas_array[0].array[0].vocabulary = vocabulary; + { will_return(__wrap_f_memory_array_adjust, false); will_return(__wrap_f_memory_array_adjust, F_okay); -- 1.8.3.1