From 8fdb75ddb198f9c03a208824b2f3d551d995ef9c Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 8 Jan 2026 20:55:16 -0600 Subject: [PATCH] Bugfix: Build and test problems. Add missing `test` mode. Some of the build settings files are missing the shared/static linking distinctions. Some of the build settings are missing static dependency files, like `-l:libfll.a`. Add missing ifdef endif comment. The `main_test__remove()` should instead be `kt_main_test__remove()`. The static string allocation functions did not get updated to match changes made for the FLL 0.8 API. Fix them and switch to the new `macro_f_string_static_t_initialize_3()`. The `__wrap_f_file_access` does not seem to be necessary anymore. I need to determine why and I need to make sure this is not some regression. For now just remove this because it is clear that I haven't kept the test files up to date. --- data/build/remove/settings-mocks.remove | 12 +-- data/build/remove/settings-tests.remove | 16 +-- data/build/stand_alone/settings/settings.remove | 4 +- data/build/stand_alone/settings/settings.rm | 4 +- data/build/stand_alone/settings/settings.rmdir | 4 +- data/build/stand_alone/settings/settings.tacocat | 4 +- data/build/stand_alone/settings/settings.unlink | 4 +- sources/c/program/kevux/tools/remove/remove/main.c | 2 +- tests/unit/remove/c/main-test-remove.c | 2 +- tests/unit/remove/c/main-test-remove.h | 2 +- tests/unit/remove/c/test-remove-date_accessed.c | 33 ++----- tests/unit/remove/c/test-remove-date_changed.c | 33 ++----- tests/unit/remove/c/test-remove-date_updated.c | 33 ++----- .../unit/remove/c/test-remove-directory_no_args.c | 109 +++------------------ .../c/test-remove-directory_recurse_simple.c | 50 ++-------- .../remove/c/test-remove-directory_tree_simple.c | 38 +------ tests/unit/remove/c/test-remove-epochtime.c | 15 +-- tests/unit/remove/c/test-remove-file_mode.c | 20 +--- tests/unit/remove/c/test-remove-file_type.c | 5 +- tests/unit/remove/c/test-remove-force.c | 2 +- tests/unit/remove/c/test-remove-group.c | 5 +- tests/unit/remove/c/test-remove-regular_no_args.c | 54 ---------- tests/unit/remove/c/test-remove-time.c | 15 +-- tests/unit/remove/c/test-remove-unix.c | 21 ++-- tests/unit/remove/c/test-remove-user.c | 15 +-- 25 files changed, 110 insertions(+), 392 deletions(-) diff --git a/data/build/remove/settings-mocks.remove b/data/build/remove/settings-mocks.remove index c51cbde..a3ce359 100644 --- a/data/build/remove/settings-mocks.remove +++ b/data/build/remove/settings-mocks.remove @@ -20,7 +20,7 @@ version_file micro version_target minor modes android clang coverage debug gcc flex_arrays fanalyzer individual individual_thread level monolithic test thread threadless -modes_default debug gcc monolithic thread +modes_default debug gcc monolithic test thread build_compiler gcc build_compiler-clang clang @@ -28,11 +28,11 @@ build_indexer ar build_indexer_arguments rcs build_language c -build_libraries -lc -build_libraries-individual -lfll_error -lfll_print -lfll_program -build_libraries-individual -lfl_conversion -lfl_directory -lfl_path -lfl_print -build_libraries-individual -lf_account -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_time -lf_type_array -lf_utf -build_libraries-individual_thread -lf_thread +build_libraries_shared -lc +build_libraries_shared-individual -lfll_error -lfll_print -lfll_program +build_libraries_shared-individual -lfl_conversion -lfl_directory -lfl_path -lfl_print +build_libraries_shared-individual -lf_account -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_time -lf_type_array -lf_utf +build_libraries_shared-individual_thread -lf_thread build_libraries_static -l:libc.a build_libraries_static-individual -l:libfll_error.a -l:libfll_print.a -l:libfll_program.a diff --git a/data/build/remove/settings-tests.remove b/data/build/remove/settings-tests.remove index b4c8c24..39d12fb 100644 --- a/data/build/remove/settings-tests.remove +++ b/data/build/remove/settings-tests.remove @@ -15,7 +15,7 @@ version_file micro version_target minor modes android clang coverage debug gcc flex_arrays fanalyzer individual individual_thread level monolithic test thread threadless -modes_default debug gcc monolithic thread +modes_default debug gcc monolithic test thread build_compiler gcc build_compiler-clang clang @@ -23,17 +23,19 @@ build_indexer ar build_indexer_arguments rcs build_language c -build_libraries -lc -lcmocka -lremove -build_libraries-individual -lfll_error -lfll_print -lfll_program -build_libraries-individual -lfl_conversion -lfl_directory -lfl_path -lfl_print -build_libraries-individual -lf_account -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_time -lf_type_array -lf_utf -build_libraries-individual_thread -lf_thread +build_libraries_shared -lc -lcmocka -lremove +build_libraries_shared-individual -lfll_error -lfll_print -lfll_program +build_libraries_shared-individual -lfl_conversion -lfl_directory -lfl_path -lfl_print +build_libraries_shared-individual -lf_account -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_time -lf_type_array -lf_utf +build_libraries_shared-individual_thread -lf_thread +build_libraries_shared-monolithic -lfll -build_libraries_static -l:libc.a +build_libraries_static -l:libc.a -l:libcmocka.a -l:libremove.a build_libraries_static-individual -l:libfll_error.a -l:libfll_print.a -l:libfll_program.a build_libraries_static-individual -l:libfl_conversion.a -l:libfl_directory.a -l:libfl_path.a -l:libfl_print.a build_libraries_static-individual -l:libf_account.a -l:libf_color.a -l:libf_compare.a -l:libf_console.a -l:libf_conversion.a -l:libf_directory.a -l:libf_file.a -l:libf_memory.a -l:libf_path.a -l:libf_pipe.a -l:libf_print.a -l:libf_rip.a -l:libf_signal.a -l:libf_string.a -l:libf_time.a -l:libf_type_array.a -l:libf_utf.a build_libraries_static-individual_thread -l:libf_thread.a +build_libraries_static-monolithic -l:libfll.a build_sources_program test-remove.c build_sources_program test-remove-date_accessed.c test-remove-date_changed.c test-remove-date_updated.c diff --git a/data/build/stand_alone/settings/settings.remove b/data/build/stand_alone/settings/settings.remove index 7065e99..dec8008 100644 --- a/data/build/stand_alone/settings/settings.remove +++ b/data/build/stand_alone/settings/settings.remove @@ -37,7 +37,9 @@ build_indexer ar build_indexer_arguments rcs build_language c -build_libraries -lc +build_libraries_shared -lc + +build_libraries_static -l:libc.a build_sources_program fll/level_0/account.c fll/level_0/private-account.c fll/level_0/account/accounts.c build_sources_program fll/level_0/color.c fll/level_0/private-color.c fll/level_0/color/common.c diff --git a/data/build/stand_alone/settings/settings.rm b/data/build/stand_alone/settings/settings.rm index 6e5494d..14913ff 100644 --- a/data/build/stand_alone/settings/settings.rm +++ b/data/build/stand_alone/settings/settings.rm @@ -37,7 +37,9 @@ build_indexer ar build_indexer_arguments rcs build_language c -build_libraries -lc +build_libraries_shared -lc + +build_libraries_static -l:libc.a build_sources_program fll/level_0/account.c fll/level_0/private-account.c fll/level_0/account/accounts.c build_sources_program fll/level_0/color.c fll/level_0/private-color.c fll/level_0/color/common.c diff --git a/data/build/stand_alone/settings/settings.rmdir b/data/build/stand_alone/settings/settings.rmdir index 1ba4143..9420cbe 100644 --- a/data/build/stand_alone/settings/settings.rmdir +++ b/data/build/stand_alone/settings/settings.rmdir @@ -37,7 +37,9 @@ build_indexer ar build_indexer_arguments rcs build_language c -build_libraries -lc +build_libraries_shared -lc + +build_libraries_static -l:libc.a build_sources_program fll/level_0/account.c fll/level_0/private-account.c fll/level_0/account/accounts.c build_sources_program fll/level_0/color.c fll/level_0/private-color.c fll/level_0/color/common.c diff --git a/data/build/stand_alone/settings/settings.tacocat b/data/build/stand_alone/settings/settings.tacocat index 780ca1c..387894f 100644 --- a/data/build/stand_alone/settings/settings.tacocat +++ b/data/build/stand_alone/settings/settings.tacocat @@ -37,7 +37,9 @@ build_indexer ar build_indexer_arguments rcs build_language c -build_libraries -lc +build_libraries_shared -lc + +build_libraries_static -l:libc.a build_sources_program fll/level_0/abstruse.c fll/level_0/abstruse/abstruse.c fll/level_0/abstruse/map.c fll/level_0/abstruse/private-abstruse.c build_sources_program fll/level_0/color.c fll/level_0/private-color.c fll/level_0/color/common.c diff --git a/data/build/stand_alone/settings/settings.unlink b/data/build/stand_alone/settings/settings.unlink index d3c8726..eab763a 100644 --- a/data/build/stand_alone/settings/settings.unlink +++ b/data/build/stand_alone/settings/settings.unlink @@ -37,7 +37,9 @@ build_indexer ar build_indexer_arguments rcs build_language c -build_libraries -lc +build_libraries_shared -lc + +build_libraries_static -l:libc.a build_sources_program fll/level_0/account.c fll/level_0/private-account.c fll/level_0/account/accounts.c build_sources_program fll/level_0/color.c fll/level_0/private-color.c fll/level_0/color/common.c diff --git a/sources/c/program/kevux/tools/remove/remove/main.c b/sources/c/program/kevux/tools/remove/remove/main.c index 11296e2..6df3a47 100644 --- a/sources/c/program/kevux/tools/remove/remove/main.c +++ b/sources/c/program/kevux/tools/remove/remove/main.c @@ -10,7 +10,7 @@ int main #else kt_main_test__remove - #endif + #endif // _kt_MOCK_MAIN_NAME (const int argc, const f_string_t *argv, const f_string_t *envp) { kt_remove_main_t data = kt_remove_main_t_initialize; diff --git a/tests/unit/remove/c/main-test-remove.c b/tests/unit/remove/c/main-test-remove.c index d2080fe..82bb586 100644 --- a/tests/unit/remove/c/main-test-remove.c +++ b/tests/unit/remove/c/main-test-remove.c @@ -4,7 +4,7 @@ extern "C" { #endif -int main_test__remove(const int argc, const f_string_t *argv, const f_string_t *envp) { +int kt_main_test__remove(const int argc, const f_string_t *argv, const f_string_t *envp) { kt_remove_main_t data = kt_remove_main_t_initialize; diff --git a/tests/unit/remove/c/main-test-remove.h b/tests/unit/remove/c/main-test-remove.h index 018c6b6..14621c7 100644 --- a/tests/unit/remove/c/main-test-remove.h +++ b/tests/unit/remove/c/main-test-remove.h @@ -32,7 +32,7 @@ extern "C" { * 0 on success. * 1 on error. */ -extern int main_test__remove(const int argc, const f_string_t *argv, const f_string_t *envp); +extern int kt_main_test__remove(const int argc, const f_string_t *argv, const f_string_t *envp); #ifdef __cplusplus } // extern "C" diff --git a/tests/unit/remove/c/test-remove-date_accessed.c b/tests/unit/remove/c/test-remove-date_accessed.c index ae5eecd..b7d3551 100644 --- a/tests/unit/remove/c/test-remove-date_accessed.c +++ b/tests/unit/remove/c/test-remove-date_accessed.c @@ -12,7 +12,7 @@ void test__kt_remove__date_accessed__date_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 18; @@ -132,9 +132,6 @@ void test__kt_remove__date_accessed__date_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -169,7 +166,7 @@ void test__kt_remove__date_accessed__now_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -187,7 +184,7 @@ void test__kt_remove__date_accessed__now_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("now", 0, 3); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("now", 3); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -289,9 +286,6 @@ void test__kt_remove__date_accessed__now_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -330,7 +324,7 @@ void test__kt_remove__date_accessed__today_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -348,7 +342,7 @@ void test__kt_remove__date_accessed__today_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("today", 0, 5); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("today", 5); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -450,9 +444,6 @@ void test__kt_remove__date_accessed__today_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -491,7 +482,7 @@ void test__kt_remove__date_accessed__tomorrow_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -509,7 +500,7 @@ void test__kt_remove__date_accessed__tomorrow_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("tomorrow", 0, 8); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("tomorrow", 8); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -611,9 +602,6 @@ void test__kt_remove__date_accessed__tomorrow_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -652,7 +640,7 @@ void test__kt_remove__date_accessed__yesterday_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -670,7 +658,7 @@ void test__kt_remove__date_accessed__yesterday_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("yesterday", 0, 9); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("yesterday", 9); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -772,9 +760,6 @@ void test__kt_remove__date_accessed__yesterday_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); diff --git a/tests/unit/remove/c/test-remove-date_changed.c b/tests/unit/remove/c/test-remove-date_changed.c index ba95e47..de44183 100644 --- a/tests/unit/remove/c/test-remove-date_changed.c +++ b/tests/unit/remove/c/test-remove-date_changed.c @@ -12,7 +12,7 @@ void test__kt_remove__date_changed__date_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 18; @@ -132,9 +132,6 @@ void test__kt_remove__date_changed__date_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -169,7 +166,7 @@ void test__kt_remove__date_changed__now_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -187,7 +184,7 @@ void test__kt_remove__date_changed__now_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("now", 0, 3); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("now", 3); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -289,9 +286,6 @@ void test__kt_remove__date_changed__now_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -330,7 +324,7 @@ void test__kt_remove__date_changed__today_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -348,7 +342,7 @@ void test__kt_remove__date_changed__today_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("today", 0, 5); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("today", 5); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -450,9 +444,6 @@ void test__kt_remove__date_changed__today_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -491,7 +482,7 @@ void test__kt_remove__date_changed__tomorrow_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -509,7 +500,7 @@ void test__kt_remove__date_changed__tomorrow_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("tomorrow", 0, 8); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("tomorrow", 8); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -611,9 +602,6 @@ void test__kt_remove__date_changed__tomorrow_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -652,7 +640,7 @@ void test__kt_remove__date_changed__yesterday_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -670,7 +658,7 @@ void test__kt_remove__date_changed__yesterday_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("yesterday", 0, 9); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("yesterday", 9); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -772,9 +760,6 @@ void test__kt_remove__date_changed__yesterday_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); diff --git a/tests/unit/remove/c/test-remove-date_updated.c b/tests/unit/remove/c/test-remove-date_updated.c index 0428aaf..abac780 100644 --- a/tests/unit/remove/c/test-remove-date_updated.c +++ b/tests/unit/remove/c/test-remove-date_updated.c @@ -12,7 +12,7 @@ void test__kt_remove__date_updated__date_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 18; @@ -132,9 +132,6 @@ void test__kt_remove__date_updated__date_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -169,7 +166,7 @@ void test__kt_remove__date_updated__now_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -187,7 +184,7 @@ void test__kt_remove__date_updated__now_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("now", 0, 3); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("now", 3); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -289,9 +286,6 @@ void test__kt_remove__date_updated__now_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -330,7 +324,7 @@ void test__kt_remove__date_updated__today_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -348,7 +342,7 @@ void test__kt_remove__date_updated__today_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("today", 0, 5); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("today", 5); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -450,9 +444,6 @@ void test__kt_remove__date_updated__today_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -491,7 +482,7 @@ void test__kt_remove__date_updated__tomorrow_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -509,7 +500,7 @@ void test__kt_remove__date_updated__tomorrow_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("tomorrow", 0, 8); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("tomorrow", 8); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -611,9 +602,6 @@ void test__kt_remove__date_updated__tomorrow_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -652,7 +640,7 @@ void test__kt_remove__date_updated__yesterday_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -670,7 +658,7 @@ void test__kt_remove__date_updated__yesterday_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("yesterday", 0, 9); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("yesterday", 9); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -772,9 +760,6 @@ void test__kt_remove__date_updated__yesterday_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); diff --git a/tests/unit/remove/c/test-remove-directory_no_args.c b/tests/unit/remove/c/test-remove-directory_no_args.c index b0dd8d8..a0a1620 100644 --- a/tests/unit/remove/c/test-remove-directory_no_args.c +++ b/tests/unit/remove/c/test-remove-directory_no_args.c @@ -12,7 +12,7 @@ void test__kt_remove__directory_no_args__one_empty_exists_link(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); struct stat stat_directory; @@ -27,9 +27,6 @@ void test__kt_remove__directory_no_args__one_empty_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -58,9 +55,6 @@ void test__kt_remove__directory_no_args__one_empty_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -89,9 +83,6 @@ void test__kt_remove__directory_no_args__one_empty_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -115,7 +106,7 @@ void test__kt_remove__directory_no_args__one_empty_exists_link_not(void **state) mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); struct stat stat_directory; @@ -130,9 +121,6 @@ void test__kt_remove__directory_no_args__one_empty_exists_link_not(void **state) will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -161,9 +149,6 @@ void test__kt_remove__directory_no_args__one_empty_exists_link_not(void **state) will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -192,9 +177,6 @@ void test__kt_remove__directory_no_args__one_empty_exists_link_not(void **state) will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -218,7 +200,7 @@ void test__kt_remove__directory_no_args__one_empty_exists_not(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); { const f_string_t argv[] = { "mocked_main", target.string, 0 }; @@ -256,7 +238,7 @@ void test__kt_remove__directory_no_args__one_empty_not_exists_link(void **state) mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); struct stat stat_directory; struct stat stat_regular; @@ -275,9 +257,6 @@ void test__kt_remove__directory_no_args__one_empty_not_exists_link(void **state) will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set. @@ -309,9 +288,6 @@ void test__kt_remove__directory_no_args__one_empty_not_exists_link(void **state) will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set. @@ -343,9 +319,6 @@ void test__kt_remove__directory_no_args__one_empty_not_exists_link(void **state) will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set. @@ -369,8 +342,8 @@ void test__kt_remove__directory_no_args__one_empty_not_exists_link_not(void **st mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); - const f_string_static_t child = macro_f_string_static_t_initialize_1("child", 0, 5); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); + const f_string_static_t child = macro_f_string_static_t_initialize_3("child", 5); struct stat stat_directory; struct stat stat_regular; @@ -389,9 +362,6 @@ void test__kt_remove__directory_no_args__one_empty_not_exists_link_not(void **st will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Top directory processing. will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set. @@ -413,9 +383,6 @@ void test__kt_remove__directory_no_args__one_empty_not_exists_link_not(void **st will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_file_remove, F_okay); will_return(__wrap_fl_directory_do, &child); @@ -451,9 +418,6 @@ void test__kt_remove__directory_no_args__one_empty_not_exists_link_not(void **st will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Top directory processing. will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set. @@ -475,9 +439,6 @@ void test__kt_remove__directory_no_args__one_empty_not_exists_link_not(void **st will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_file_remove, F_okay); will_return(__wrap_fl_directory_do, &child); @@ -513,9 +474,6 @@ void test__kt_remove__directory_no_args__one_empty_not_exists_link_not(void **st will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Top directory processing. will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set. @@ -537,9 +495,6 @@ void test__kt_remove__directory_no_args__one_empty_not_exists_link_not(void **st will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_file_remove, F_okay); will_return(__wrap_fl_directory_do, &child); @@ -567,8 +522,8 @@ void test__kt_remove__directory_no_args__two_empty_exists_and_not(void **state) mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); - const f_string_static_t target_also = macro_f_string_static_t_initialize_1("also/remove", 0, 11); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); + const f_string_static_t target_also = macro_f_string_static_t_initialize_3("also/remove", 11); struct stat stat_directory; @@ -623,8 +578,8 @@ void test__kt_remove__directory_no_args__two_empty_exists_link(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); - const f_string_static_t target_also = macro_f_string_static_t_initialize_1("also/remove", 0, 11); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); + const f_string_static_t target_also = macro_f_string_static_t_initialize_3("also/remove", 11); struct stat stat_directory; @@ -639,9 +594,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -659,9 +611,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -690,9 +639,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -710,9 +656,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -741,9 +684,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -761,9 +701,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -787,8 +724,8 @@ void test__kt_remove__directory_no_args__two_empty_exists_link_not(void **state) mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); - const f_string_static_t target_also = macro_f_string_static_t_initialize_1("also/remove", 0, 11); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); + const f_string_static_t target_also = macro_f_string_static_t_initialize_3("also/remove", 11); struct stat stat_directory; @@ -803,9 +740,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link_not(void **state) will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -823,9 +757,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link_not(void **state) will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -854,9 +785,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link_not(void **state) will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -874,9 +802,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link_not(void **state) will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -905,9 +830,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link_not(void **state) will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -925,9 +847,6 @@ void test__kt_remove__directory_no_args__two_empty_exists_link_not(void **state) will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Directory processing. will_return(__wrap_f_directory_empty, F_true); @@ -951,8 +870,8 @@ void test__kt_remove__directory_no_args__two_empty_exists_not(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); - const f_string_static_t target_also = macro_f_string_static_t_initialize_1("also/remove", 0, 11); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); + const f_string_static_t target_also = macro_f_string_static_t_initialize_3("also/remove", 11); { const f_string_t argv[] = { "mocked_main", target.string, target_also.string, 0 }; diff --git a/tests/unit/remove/c/test-remove-directory_recurse_simple.c b/tests/unit/remove/c/test-remove-directory_recurse_simple.c index 8b9fb2e..2839598 100644 --- a/tests/unit/remove/c/test-remove-directory_recurse_simple.c +++ b/tests/unit/remove/c/test-remove-directory_recurse_simple.c @@ -12,8 +12,8 @@ void test__kt_remove__directory_recurse_simple__one_child_one_exists_link(void * mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); - const f_string_static_t child_1 = macro_f_string_static_t_initialize_1("child_1", 0, 7); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); + const f_string_static_t child_1 = macro_f_string_static_t_initialize_3("child_1", 7); struct stat stat_directory; struct stat stat_regular; @@ -32,9 +32,6 @@ void test__kt_remove__directory_recurse_simple__one_child_one_exists_link(void * will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Top directory processing. will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set. @@ -56,9 +53,6 @@ void test__kt_remove__directory_recurse_simple__one_child_one_exists_link(void * will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_file_remove, F_okay); will_return(__wrap_fl_directory_do, &child_1); @@ -86,8 +80,8 @@ void test__kt_remove__directory_recurse_simple__one_child_one_exists_link_not(vo mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); - const f_string_static_t child_1 = macro_f_string_static_t_initialize_1("child_1", 0, 7); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); + const f_string_static_t child_1 = macro_f_string_static_t_initialize_3("child_1", 7); struct stat stat_directory; struct stat stat_regular; @@ -106,9 +100,6 @@ void test__kt_remove__directory_recurse_simple__one_child_one_exists_link_not(vo will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Target Directory pre-processing, begin, perform directory listing action. will_return(__wrap_f_directory_empty, F_false); @@ -130,9 +121,6 @@ void test__kt_remove__directory_recurse_simple__one_child_one_exists_link_not(vo will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_file_remove, F_okay); will_return(__wrap_fl_directory_do, &child_1); @@ -160,9 +148,9 @@ void test__kt_remove__directory_recurse_simple__one_child_two_exists_link(void * mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); - const f_string_static_t child_1 = macro_f_string_static_t_initialize_1("child_1", 0, 7); - const f_string_static_t child_2 = macro_f_string_static_t_initialize_1("child_2", 0, 7); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); + const f_string_static_t child_1 = macro_f_string_static_t_initialize_3("child_1", 7); + const f_string_static_t child_2 = macro_f_string_static_t_initialize_3("child_2", 7); struct stat stat_directory; struct stat stat_regular; @@ -181,9 +169,6 @@ void test__kt_remove__directory_recurse_simple__one_child_two_exists_link(void * will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Top directory processing. will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set. @@ -205,9 +190,6 @@ void test__kt_remove__directory_recurse_simple__one_child_two_exists_link(void * will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_file_remove, F_okay); will_return(__wrap_fl_directory_do, &child_1); @@ -225,9 +207,6 @@ void test__kt_remove__directory_recurse_simple__one_child_two_exists_link(void * will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_file_remove, F_okay); will_return(__wrap_fl_directory_do, &child_2); @@ -255,9 +234,9 @@ void test__kt_remove__directory_recurse_simple__one_child_two_exists_link_not(vo mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); - const f_string_static_t child_1 = macro_f_string_static_t_initialize_1("child_1", 0, 7); - const f_string_static_t child_2 = macro_f_string_static_t_initialize_1("child_2", 0, 7); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); + const f_string_static_t child_1 = macro_f_string_static_t_initialize_3("child_1", 7); + const f_string_static_t child_2 = macro_f_string_static_t_initialize_3("child_2", 7); struct stat stat_directory; struct stat stat_regular; @@ -276,9 +255,6 @@ void test__kt_remove__directory_recurse_simple__one_child_two_exists_link_not(vo will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Top directory processing. will_return(__wrap_f_directory_empty, F_false); // kt_remove_flag_operate_empty_d is set. @@ -300,9 +276,6 @@ void test__kt_remove__directory_recurse_simple__one_child_two_exists_link_not(vo will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_file_remove, F_okay); will_return(__wrap_fl_directory_do, &child_1); @@ -320,9 +293,6 @@ void test__kt_remove__directory_recurse_simple__one_child_two_exists_link_not(vo will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_file_remove, F_okay); will_return(__wrap_fl_directory_do, &child_2); diff --git a/tests/unit/remove/c/test-remove-directory_tree_simple.c b/tests/unit/remove/c/test-remove-directory_tree_simple.c index b41c300..a51b016 100644 --- a/tests/unit/remove/c/test-remove-directory_tree_simple.c +++ b/tests/unit/remove/c/test-remove-directory_tree_simple.c @@ -12,7 +12,7 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_one_exists_li mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target_full = macro_f_string_static_t_initialize_1("parent_1/to_remove", 0, 18); + const f_string_static_t target_full = macro_f_string_static_t_initialize_3("parent_1/to_remove", 18); struct stat stat_directory; struct stat stat_regular; @@ -31,9 +31,6 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_one_exists_li will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Target processing. will_return(__wrap_f_file_remove, F_okay); @@ -43,9 +40,6 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_one_exists_li will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_directory_empty, F_true); // Parent 1 processing. @@ -62,7 +56,7 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_one_exists_li mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target_full = macro_f_string_static_t_initialize_1("parent_1/to_remove", 0, 18); + const f_string_static_t target_full = macro_f_string_static_t_initialize_3("parent_1/to_remove", 18); struct stat stat_directory; struct stat stat_regular; @@ -81,9 +75,6 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_one_exists_li will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Target processing. will_return(__wrap_f_file_remove, F_okay); @@ -93,9 +84,6 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_one_exists_li will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_directory_empty, F_true); // Parent 1 processing. @@ -112,7 +100,7 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_two_exists_li mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target_full = macro_f_string_static_t_initialize_1("parent_2/parent_1/to_remove", 0, 18); + const f_string_static_t target_full = macro_f_string_static_t_initialize_3("parent_2/parent_1/to_remove", 18); struct stat stat_directory; struct stat stat_regular; @@ -131,9 +119,6 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_two_exists_li will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Target processing. will_return(__wrap_f_file_remove, F_okay); @@ -143,9 +128,6 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_two_exists_li will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_directory_empty, F_true); // Parent 1 processing. @@ -156,9 +138,6 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_two_exists_li will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_directory_empty, F_true); // Parent 2 processing. @@ -175,7 +154,7 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_two_exists_li mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target_full = macro_f_string_static_t_initialize_1("parent_2/parent_1/to_remove", 0, 18); + const f_string_static_t target_full = macro_f_string_static_t_initialize_3("parent_2/parent_1/to_remove", 18); struct stat stat_directory; struct stat stat_regular; @@ -194,9 +173,6 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_two_exists_li will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_regular); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // Target processing. will_return(__wrap_f_file_remove, F_okay); @@ -206,9 +182,6 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_two_exists_li will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_directory_empty, F_true); // Parent 1 processing. @@ -219,9 +192,6 @@ void test__kt_remove__directory_tree_simple__one_child_none_parent_two_exists_li will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stat_directory); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); will_return(__wrap_f_directory_empty, F_true); // Parent 2 processing. diff --git a/tests/unit/remove/c/test-remove-epochtime.c b/tests/unit/remove/c/test-remove-epochtime.c index 559a2c8..6d86883 100644 --- a/tests/unit/remove/c/test-remove-epochtime.c +++ b/tests/unit/remove/c/test-remove-epochtime.c @@ -12,7 +12,7 @@ void test__kt_remove__epochtime__accessed_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t params_total = 2; const uint8_t types_total = 8; @@ -137,9 +137,6 @@ void test__kt_remove__epochtime__accessed_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -174,7 +171,7 @@ void test__kt_remove__epochtime__changed_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t params_total = 2; const uint8_t types_total = 8; @@ -299,9 +296,6 @@ void test__kt_remove__epochtime__changed_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -336,7 +330,7 @@ void test__kt_remove__epochtime__updated_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t params_total = 2; const uint8_t types_total = 8; @@ -461,9 +455,6 @@ void test__kt_remove__epochtime__updated_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); diff --git a/tests/unit/remove/c/test-remove-file_mode.c b/tests/unit/remove/c/test-remove-file_mode.c index 89d599e..f38471b 100644 --- a/tests/unit/remove/c/test-remove-file_mode.c +++ b/tests/unit/remove/c/test-remove-file_mode.c @@ -12,7 +12,7 @@ void test__kt_remove__file_mode__different_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t modes_total = 10; // For both modes and params. @@ -83,9 +83,6 @@ void test__kt_remove__file_mode__different_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(statistics.st_mode)); will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(statistics.st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -121,7 +118,7 @@ void test__kt_remove__file_mode__same_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t modes_total = 10; // For both modes and params. @@ -192,9 +189,6 @@ void test__kt_remove__file_mode__same_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(statistics.st_mode)); will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(statistics.st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -230,7 +224,7 @@ void test__kt_remove__file_mode__similar_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t modes_total = 10; // For both modes and params. @@ -301,9 +295,6 @@ void test__kt_remove__file_mode__similar_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(statistics.st_mode)); will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(statistics.st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -338,7 +329,7 @@ void test__kt_remove__file_mode__not_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t modes_total = 10; // For both modes and params. @@ -409,9 +400,6 @@ void test__kt_remove__file_mode__not_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(statistics.st_mode)); will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(statistics.st_mode)) { will_return(__wrap_f_directory_empty, F_true); diff --git a/tests/unit/remove/c/test-remove-file_type.c b/tests/unit/remove/c/test-remove-file_type.c index 408d7c8..3b360fb 100644 --- a/tests/unit/remove/c/test-remove-file_type.c +++ b/tests/unit/remove/c/test-remove-file_type.c @@ -12,7 +12,7 @@ void test__kt_remove__file_type__works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t total = 8; @@ -55,9 +55,6 @@ void test__kt_remove__file_type__works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[i].st_mode)); will_return(__wrap_f_file_stat, &stats[i]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[i].st_mode)) { diff --git a/tests/unit/remove/c/test-remove-force.c b/tests/unit/remove/c/test-remove-force.c index 19cfbe9..ded307b 100644 --- a/tests/unit/remove/c/test-remove-force.c +++ b/tests/unit/remove/c/test-remove-force.c @@ -12,7 +12,7 @@ void test__kt_remove__force__works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t total = 8; diff --git a/tests/unit/remove/c/test-remove-group.c b/tests/unit/remove/c/test-remove-group.c index 368694f..bd9d0bf 100644 --- a/tests/unit/remove/c/test-remove-group.c +++ b/tests/unit/remove/c/test-remove-group.c @@ -12,7 +12,7 @@ void test__kt_remove__group__name_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const f_string_t argv[] = { "mocked_main", target.string, "-" KT_REMOVE_short_group_s, "some_name", 0 }; const uint8_t total = 4; @@ -42,9 +42,6 @@ void test__kt_remove__group__name_works(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); diff --git a/tests/unit/remove/c/test-remove-regular_no_args.c b/tests/unit/remove/c/test-remove-regular_no_args.c index 69ae8bb..d93ab48 100644 --- a/tests/unit/remove/c/test-remove-regular_no_args.c +++ b/tests/unit/remove/c/test-remove-regular_no_args.c @@ -25,9 +25,6 @@ void test__kt_remove__regular_no_args__one_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -48,9 +45,6 @@ void test__kt_remove__regular_no_args__one_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -71,9 +65,6 @@ void test__kt_remove__regular_no_args__one_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -102,9 +93,6 @@ void test__kt_remove__regular_no_args__one_exists_link_not(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -125,9 +113,6 @@ void test__kt_remove__regular_no_args__one_exists_link_not(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -148,9 +133,6 @@ void test__kt_remove__regular_no_args__one_exists_link_not(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -268,9 +250,6 @@ void test__kt_remove__regular_no_args__two_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -280,9 +259,6 @@ void test__kt_remove__regular_no_args__two_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -303,9 +279,6 @@ void test__kt_remove__regular_no_args__two_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -315,9 +288,6 @@ void test__kt_remove__regular_no_args__two_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -338,9 +308,6 @@ void test__kt_remove__regular_no_args__two_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -350,9 +317,6 @@ void test__kt_remove__regular_no_args__two_exists_link(void **state) { will_return(__wrap_f_file_is, F_true); // A link, kt_remove_flag_operate_link_d is set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -381,9 +345,6 @@ void test__kt_remove__regular_no_args__two_exists_link_not(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -393,9 +354,6 @@ void test__kt_remove__regular_no_args__two_exists_link_not(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -416,9 +374,6 @@ void test__kt_remove__regular_no_args__two_exists_link_not(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -428,9 +383,6 @@ void test__kt_remove__regular_no_args__two_exists_link_not(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -451,9 +403,6 @@ void test__kt_remove__regular_no_args__two_exists_link_not(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); @@ -463,9 +412,6 @@ void test__kt_remove__regular_no_args__two_exists_link_not(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &statistics); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); // This will fail if f_file_remove() is not called, therefore success here means f_file_remove has been called. will_return(__wrap_f_file_remove, F_okay); diff --git a/tests/unit/remove/c/test-remove-time.c b/tests/unit/remove/c/test-remove-time.c index b7aed04..2f55c6e 100644 --- a/tests/unit/remove/c/test-remove-time.c +++ b/tests/unit/remove/c/test-remove-time.c @@ -12,7 +12,7 @@ void test__kt_remove__time__accessed_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t params_total = 2; const uint8_t types_total = 8; @@ -139,9 +139,6 @@ void test__kt_remove__time__accessed_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (param) { will_return(__wrap_f_time_clock_get, &time_spec_clocks); @@ -181,7 +178,7 @@ void test__kt_remove__time__changed_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t params_total = 2; const uint8_t types_total = 8; @@ -308,9 +305,6 @@ void test__kt_remove__time__changed_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (param) { will_return(__wrap_f_time_clock_get, &time_spec_clocks); @@ -350,7 +344,7 @@ void test__kt_remove__time__updated_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t params_total = 2; const uint8_t types_total = 8; @@ -477,9 +471,6 @@ void test__kt_remove__time__updated_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (param) { will_return(__wrap_f_time_clock_get, &time_spec_clocks); diff --git a/tests/unit/remove/c/test-remove-unix.c b/tests/unit/remove/c/test-remove-unix.c index 876a5fc..28e25d1 100644 --- a/tests/unit/remove/c/test-remove-unix.c +++ b/tests/unit/remove/c/test-remove-unix.c @@ -13,7 +13,7 @@ void test__kt_remove__unix__accessed_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -31,7 +31,7 @@ void test__kt_remove__unix__accessed_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("172800", 0, 6); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("172800", 6); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -131,9 +131,6 @@ void test__kt_remove__unix__accessed_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -167,7 +164,7 @@ void test__kt_remove__unix__changed_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -185,7 +182,7 @@ void test__kt_remove__unix__changed_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("172800", 0, 6); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("172800", 6); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -285,9 +282,6 @@ void test__kt_remove__unix__changed_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -321,7 +315,7 @@ void test__kt_remove__unix__updated_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 0; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const uint8_t types_total = 8; const uint8_t dates_total = 24; @@ -339,7 +333,7 @@ void test__kt_remove__unix__updated_works(void **state) { stats[6].st_mode = F_file_mode_all_d | F_file_type_socket_d; stats[7].st_mode = F_file_mode_all_d & ~S_IFMT; - const f_string_static_t parameter = macro_f_string_static_t_initialize_1("172800", 0, 6); + const f_string_static_t parameter = macro_f_string_static_t_initialize_3("172800", 6); const f_string_static_t operators[] = { kt_remove_date_symbol_equal_s, @@ -439,9 +433,6 @@ void test__kt_remove__unix__updated_works(void **state) { will_return(__wrap_f_file_is, macro_f_file_type_is_link(stats[type].st_mode)); will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); diff --git a/tests/unit/remove/c/test-remove-user.c b/tests/unit/remove/c/test-remove-user.c index 54f89f1..292aa55 100644 --- a/tests/unit/remove/c/test-remove-user.c +++ b/tests/unit/remove/c/test-remove-user.c @@ -12,7 +12,7 @@ void test__kt_remove__user__different_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const f_string_t argv[] = { "mocked_main", target.string, "-" KT_REMOVE_short_different_s, 0 }; const uint8_t total = 4; @@ -42,9 +42,6 @@ void test__kt_remove__user__different_works(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -76,7 +73,7 @@ void test__kt_remove__user__name_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const f_string_t argv[] = { "mocked_main", target.string, "-" KT_REMOVE_short_user_s, "some_name", 0 }; const uint8_t total = 4; @@ -106,9 +103,6 @@ void test__kt_remove__user__name_works(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); @@ -140,7 +134,7 @@ void test__kt_remove__user__same_works(void **state) { mock_unwrap = 0; mock_unwrap_f_time_clock_get = 1; - const f_string_static_t target = macro_f_string_static_t_initialize_1("to_remove", 0, 9); + const f_string_static_t target = macro_f_string_static_t_initialize_3("to_remove", 9); const f_string_t argv[] = { "mocked_main", target.string, "-" KT_REMOVE_short_same_s, 0 }; const uint8_t total = 4; @@ -170,9 +164,6 @@ void test__kt_remove__user__same_works(void **state) { will_return(__wrap_f_file_is, F_false); // Not a link, kt_remove_flag_operate_link_d is not set. will_return(__wrap_f_file_stat, &stats[type]); will_return(__wrap_f_file_stat, F_okay); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); - will_return(__wrap_f_file_access, F_true); if (macro_f_file_type_is_directory(stats[type].st_mode)) { will_return(__wrap_f_directory_empty, F_true); -- 1.8.3.1