From 471d749d817b18b112cb16f170b2bf965e3e8aa7 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 31 Mar 2023 17:57:17 -0500 Subject: [PATCH] Update: Relocate fll_status_string to fl_status_string, fix failing tests, and update relating projects. Now the f_compare exists the fll_status_string only depends on level 0 projects. This can now be moved from a level 2 project into a level 1 project. The fll_fss_status_code can now call fl_status_code. --- build/disable/level_2/fll_status_string.h | 2 +- build/level_1/settings | 2 + build/level_2/settings | 2 - build/monolithic/settings | 4 +- build/scripts/bootstrap-example.sh | 2 +- build/scripts/test.sh | 2 +- .../fl_status_string}/c/status_string.c | 67 ++++++++++++++++----- .../fl_status_string}/c/status_string.h | 14 ++--- .../fl_status_string}/data/build/defines | 0 .../fl_status_string}/data/build/dependencies | 0 .../data/build/dependencies-tests | 0 .../fl_status_string}/data/build/fakefile | 0 .../fl_status_string}/data/build/settings | 4 +- .../fl_status_string}/data/build/settings-tests | 4 +- .../fl_status_string}/data/build/testfile | 0 .../tests/unit/c/test-status_string-from.c | 68 +++++++++++++++++----- .../tests/unit/c/test-status_string-from.h | 41 +++++++++++++ .../tests/unit/c/test-status_string.c | 8 +-- .../tests/unit/c/test-status_string.h | 12 ++-- .../fll_fss_status_string/c/fss_status_string.c | 17 ++---- .../fll_fss_status_string/c/fss_status_string.h | 6 ++ .../fll_fss_status_string/data/build/dependencies | 1 + level_2/fll_fss_status_string/data/build/settings | 2 +- .../tests/unit/c/test-status_string-from.h | 41 ------------- level_3/control/c/control.h | 2 +- level_3/control/c/private-control.c | 2 +- level_3/control/c/private-control.h | 2 +- level_3/control/data/build/settings | 2 +- level_3/controller/c/controller.h | 2 +- level_3/status_code/c/main/common/type.h | 2 +- level_3/status_code/c/main/main.c | 2 +- level_3/status_code/c/main/process.h | 4 +- level_3/status_code/c/main/status_code.h | 2 +- level_3/status_code/data/build/dependencies | 1 + level_3/status_code/data/build/dependencies.fss | 1 + level_3/status_code/data/build/settings | 2 +- level_3/status_code/data/build/settings.fss | 2 +- level_3/status_code/data/build/settings.main | 2 +- 38 files changed, 205 insertions(+), 122 deletions(-) rename {level_2/fll_status_string => level_1/fl_status_string}/c/status_string.c (98%) rename {level_2/fll_status_string => level_1/fl_status_string}/c/status_string.h (80%) rename {level_2/fll_status_string => level_1/fl_status_string}/data/build/defines (100%) rename {level_2/fll_status_string => level_1/fl_status_string}/data/build/dependencies (100%) rename {level_2/fll_status_string => level_1/fl_status_string}/data/build/dependencies-tests (100%) rename {level_2/fll_status_string => level_1/fl_status_string}/data/build/fakefile (100%) rename {level_2/fll_status_string => level_1/fl_status_string}/data/build/settings (96%) rename {level_2/fll_status_string => level_1/fl_status_string}/data/build/settings-tests (92%) rename {level_2/fll_status_string => level_1/fl_status_string}/data/build/testfile (100%) rename {level_2/fll_status_string => level_1/fl_status_string}/tests/unit/c/test-status_string-from.c (94%) create mode 100644 level_1/fl_status_string/tests/unit/c/test-status_string-from.h rename {level_2/fll_status_string => level_1/fl_status_string}/tests/unit/c/test-status_string.c (62%) rename {level_2/fll_status_string => level_1/fl_status_string}/tests/unit/c/test-status_string.h (83%) delete mode 100644 level_2/fll_status_string/tests/unit/c/test-status_string-from.h diff --git a/build/disable/level_2/fll_status_string.h b/build/disable/level_2/fll_status_string.h index 7580596..371f7fd 100644 --- a/build/disable/level_2/fll_status_string.h +++ b/build/disable/level_2/fll_status_string.h @@ -1,4 +1,4 @@ -#define _di_fll_status_string_from_ +#define _di_fl_status_string_from_ #define _di_f_status_access_s_ #define _di_f_status_array_s_ #define _di_f_status_available_s_ diff --git a/build/level_1/settings b/build/level_1/settings index 9e99410..d61f45b 100644 --- a/build/level_1/settings +++ b/build/level_1/settings @@ -30,6 +30,7 @@ build_sources_library iki.c build_sources_library path.c build_sources_library print.c private-print.c print/common.c build_sources_library signal.c +build_sources_library status_string.c build_sources_library utf_file.c private-utf_file.c build_sources_headers control_group.h @@ -42,6 +43,7 @@ build_sources_headers iki.h build_sources_headers path.h build_sources_headers print.h print/common.h build_sources_headers signal.h signal/common.h +build_sources_headers status_string.h build_sources_headers utf_file.h build_script yes diff --git a/build/level_2/settings b/build/level_2/settings index 0869221..606cb6b 100644 --- a/build/level_2/settings +++ b/build/level_2/settings @@ -30,7 +30,6 @@ build_sources_library fss_status_string.c build_sources_library iki.c private-iki.c build_sources_library print.c build_sources_library program.c program/common.c program/print.c private-program.c -build_sources_library status_string.c build_sources_headers control_group.h build_sources_headers error.h error/common.h @@ -41,7 +40,6 @@ build_sources_headers fss_status_string.h build_sources_headers iki.h build_sources_headers print.h build_sources_headers program.h program/common.h program/print.h -build_sources_headers status_string.h build_script yes build_shared yes diff --git a/build/monolithic/settings b/build/monolithic/settings index 59671b5..25aff4a 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -73,6 +73,7 @@ build_sources_library level_1/iki.c build_sources_library level_1/path.c build_sources_library level_1/print.c level_1/private-print.c level_1/print/common.c build_sources_library level_1/signal.c +build_sources_library level_1/status_string.c build_sources_library level_1/utf_file.c level_1/private-utf_file.c build_sources_library level_2/control_group.c @@ -84,7 +85,6 @@ build_sources_library level_2/fss_status_string.c build_sources_library level_2/iki.c level_2/private-iki.c build_sources_library level_2/print.c build_sources_library level_2/program.c level_2/program/common.c level_2/program/print.c level_2/private-program.c -build_sources_library level_2/status_string.c build_sources_library-monolithic level_0/thread.c level_0/private-thread.c level_0/thread/attribute.c level_0/thread/barrier.c level_0/thread/barrier_attribute.c level_0/thread/condition.c level_0/thread/condition_attribute.c level_0/thread/id.c level_0/thread/key.c level_0/thread/lock.c level_0/thread/lock_attribute.c level_0/thread/mutex.c level_0/thread/mutex_attribute.c level_0/thread/once.c level_0/thread/semaphore.c level_0/thread/set.c level_0/thread/spin.c @@ -136,6 +136,7 @@ build_sources_headers level_1/iki.h build_sources_headers level_1/path.h build_sources_headers level_1/print.h level_1/print/common.h build_sources_headers level_1/signal.h level_1/signal/common.h +build_sources_headers level_1/status_string.h build_sources_headers level_1/utf_file.h build_sources_headers level_2/control_group.h @@ -147,7 +148,6 @@ build_sources_headers level_2/fss_status_string.h build_sources_headers level_2/iki.h build_sources_headers level_2/print.h build_sources_headers level_2/program.h level_2/program/common.h level_2/program/print.h -build_sources_headers level_2/status_string.h build_sources_headers-monolithic level_0/thread.h level_0/thread/attribute.h level_0/thread/barrier.h level_0/thread/barrier_attribute.h level_0/thread/condition.h level_0/thread/condition_attribute.h level_0/thread/id.h level_0/thread/key.h level_0/thread/lock.h level_0/thread/lock_attribute.h level_0/thread/mutex.h level_0/thread/mutex_attribute.h level_0/thread/once.h level_0/thread/semaphore.h level_0/thread/set.h level_0/thread/spin.h diff --git a/build/scripts/bootstrap-example.sh b/build/scripts/bootstrap-example.sh index 65c8518..8e1703b 100644 --- a/build/scripts/bootstrap-example.sh +++ b/build/scripts/bootstrap-example.sh @@ -125,7 +125,7 @@ if [[ $1 == "individual" ]] ; then $shell_command build/scripts/package.sh $verbose $color rebuild -i if [[ $? -eq 0 ]] ; then - for i in f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_parse f_path f_pipe f_print f_rip f_status_string f_serialize f_signal f_socket f_thread fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print fl_signal fl_utf_file fll_control_group fll_error fll_execute fll_file fll_fss fll_fss_status_string fll_iki fll_print fll_program fll_status_string ; do + for i in f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_parse f_path f_pipe f_print f_rip f_status_string f_serialize f_signal f_socket f_thread fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print fl_signal fl_status_string fl_utf_file fll_control_group fll_error fll_execute fll_file fll_fss fll_fss_status_string fll_iki fll_print fll_program ; do echo && echo "Processing $i." && cd package/individual/$i-$version/ && diff --git a/build/scripts/test.sh b/build/scripts/test.sh index 8f38cb4..b24e799 100644 --- a/build/scripts/test.sh +++ b/build/scripts/test.sh @@ -67,7 +67,7 @@ test_main() { local verbose= local verbose_common= - local projects="f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_parse f_path f_pipe f_print f_rip f_serialize f_signal f_socket f_status_string f_thread fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print fl_signal fl_utf_file fll_control_group fll_error fll_execute fll_file fll_fss fll_fss_status_string fll_iki fll_print fll_program fll_status_string" + local projects="f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_parse f_path f_pipe f_print f_rip f_serialize f_signal f_socket f_status_string f_thread fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print fl_signal fl_status_string fl_utf_file fll_control_group fll_error fll_execute fll_file fll_fss fll_fss_status_string fll_iki fll_print fll_program" local projects_no_tests="f_type" if [[ $# -gt 0 ]] ; then diff --git a/level_2/fll_status_string/c/status_string.c b/level_1/fl_status_string/c/status_string.c similarity index 98% rename from level_2/fll_status_string/c/status_string.c rename to level_1/fl_status_string/c/status_string.c index 56f6f32..185626f 100644 --- a/level_2/fll_status_string/c/status_string.c +++ b/level_1/fl_status_string/c/status_string.c @@ -4,26 +4,19 @@ extern "C" { #endif -#ifndef _di_fll_status_string_from_ - f_status_t fll_status_string_from(const f_string_static_t name, f_status_t * const code) { +#ifndef _di_fl_status_string_from_ + f_status_t fl_status_string_from(const f_string_static_t name, f_status_t * const code) { #ifndef _di_level_2_parameter_checking_ if (!code) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ f_status_t status = F_none; - if (!name.used) { - return F_data_not; - } + if (!name.used) return F_data_not; // Numbers are not valid status code strings. - if ((status = f_conversion_character_is_decimal(name.string[0])) == F_true) { - return F_status_set_error(F_data); - } - - if (F_status_is_error(status)) { - return status; - } + if ((status = f_conversion_character_is_decimal(name.string[0])) == F_true) return F_status_set_error(F_data); + if (F_status_is_error(status)) return status; #ifndef _di_f_status_boolean_s_ if (f_compare_dynamic(name, f_status_false_s) == F_equal_to) { @@ -1482,6 +1475,18 @@ extern "C" { return F_none; } + if (f_compare_dynamic(name, f_status_okay_s) == F_equal_to) { + *code = F_okay; + + return F_none; + } + + if (f_compare_dynamic(name, f_status_okay_not_s) == F_equal_to) { + *code = F_okay_not; + + return F_none; + } + if (f_compare_dynamic(name, f_status_once_s) == F_equal_to) { *code = F_once; @@ -2768,6 +2773,12 @@ extern "C" { return F_none; } + if (f_compare_dynamic(name, f_status_complete_not_utf_start_s) == F_equal_to) { + *code = F_complete_not_utf_start; + + return F_none; + } + if (f_compare_dynamic(name, f_status_complete_not_utf_stop_s) == F_equal_to) { *code = F_complete_not_utf_stop; @@ -2804,6 +2815,12 @@ extern "C" { return F_none; } + if (f_compare_dynamic(name, f_status_none_start_s) == F_equal_to) { + *code = F_none_start; + + return F_none; + } + if (f_compare_dynamic(name, f_status_none_stop_s) == F_equal_to) { *code = F_none_stop; @@ -2852,6 +2869,12 @@ extern "C" { return F_none; } + if (f_compare_dynamic(name, f_status_data_not_start_s) == F_equal_to) { + *code = F_data_not_start; + + return F_none; + } + if (f_compare_dynamic(name, f_status_data_not_stop_s) == F_equal_to) { *code = F_data_not_stop; @@ -2938,6 +2961,12 @@ extern "C" { return F_none; } + if (f_compare_dynamic(name, f_status_end_not_group_start_s) == F_equal_to) { + *code = F_end_not_group_start; + + return F_none; + } + if (f_compare_dynamic(name, f_status_end_not_group_stop_s) == F_equal_to) { *code = F_end_not_group_stop; @@ -2980,12 +3009,24 @@ extern "C" { return F_none; } + if (f_compare_dynamic(name, f_status_end_not_nest_start_s) == F_equal_to) { + *code = F_end_not_nest_start; + + return F_none; + } + if (f_compare_dynamic(name, f_status_end_not_nest_stop_s) == F_equal_to) { *code = F_end_not_nest_stop; return F_none; } + if (f_compare_dynamic(name, f_status_end_not_start_s) == F_equal_to) { + *code = F_end_not_start; + + return F_none; + } + if (f_compare_dynamic(name, f_status_end_not_stop_s) == F_equal_to) { *code = F_end_not_stop; @@ -3701,7 +3742,7 @@ extern "C" { return F_status_set_error(F_data); } -#endif // _di_fll_status_string_from_ +#endif // _di_fl_status_string_from_ #ifdef __cplusplus } // extern "C" diff --git a/level_2/fll_status_string/c/status_string.h b/level_1/fl_status_string/c/status_string.h similarity index 80% rename from level_2/fll_status_string/c/status_string.h rename to level_1/fl_status_string/c/status_string.h index 87a3c1b..ba9f50e 100644 --- a/level_2/fll_status_string/c/status_string.h +++ b/level_1/fl_status_string/c/status_string.h @@ -1,5 +1,5 @@ /** - * FLL - Level 2 + * FLL - Level 1 * * Project: Status * API Version: 0.7 @@ -7,8 +7,8 @@ * * Provides status code functions, such as those that translate status codes into strings. */ -#ifndef _FLL_status_string_h -#define _FLL_status_string_h +#ifndef _FL_status_string_h +#define _FL_status_string_h // FLL-0 includes. #include @@ -46,12 +46,12 @@ extern "C" { * * Errors (with error bit) from: f_conversion_character_is_decimal(). */ -#ifndef _di_fll_status_string_from_ - extern f_status_t fll_status_string_from(const f_string_static_t name, f_status_t * const code); -#endif // _di_fll_status_string_to_ +#ifndef _di_fl_status_string_from_ + extern f_status_t fl_status_string_from(const f_string_static_t name, f_status_t * const code); +#endif // _di_fl_status_string_to_ #ifdef __cplusplus } // extern "C" #endif -#endif // _FLL_status_string_h +#endif // _FL_status_string_h diff --git a/level_2/fll_status_string/data/build/defines b/level_1/fl_status_string/data/build/defines similarity index 100% rename from level_2/fll_status_string/data/build/defines rename to level_1/fl_status_string/data/build/defines diff --git a/level_2/fll_status_string/data/build/dependencies b/level_1/fl_status_string/data/build/dependencies similarity index 100% rename from level_2/fll_status_string/data/build/dependencies rename to level_1/fl_status_string/data/build/dependencies diff --git a/level_2/fll_status_string/data/build/dependencies-tests b/level_1/fl_status_string/data/build/dependencies-tests similarity index 100% rename from level_2/fll_status_string/data/build/dependencies-tests rename to level_1/fl_status_string/data/build/dependencies-tests diff --git a/level_2/fll_status_string/data/build/fakefile b/level_1/fl_status_string/data/build/fakefile similarity index 100% rename from level_2/fll_status_string/data/build/fakefile rename to level_1/fl_status_string/data/build/fakefile diff --git a/level_2/fll_status_string/data/build/settings b/level_1/fl_status_string/data/build/settings similarity index 96% rename from level_2/fll_status_string/data/build/settings rename to level_1/fl_status_string/data/build/settings index a912a71..d585234 100644 --- a/level_2/fll_status_string/data/build/settings +++ b/level_1/fl_status_string/data/build/settings @@ -1,6 +1,6 @@ # fss-0001 -build_name fll_status_string +build_name fl_status_string version_major 0 version_minor 7 @@ -28,7 +28,7 @@ build_script yes build_shared yes build_static no -path_headers fll/level_2 +path_headers fll/level_1 path_library_script script path_library_shared shared path_library_static static diff --git a/level_2/fll_status_string/data/build/settings-tests b/level_1/fl_status_string/data/build/settings-tests similarity index 92% rename from level_2/fll_status_string/data/build/settings-tests rename to level_1/fl_status_string/data/build/settings-tests index b2b0120..297dd1e 100644 --- a/level_2/fll_status_string/data/build/settings-tests +++ b/level_1/fl_status_string/data/build/settings-tests @@ -5,7 +5,7 @@ # Memory leaks in the test program can be checked for by running valgrind with this executable. # -build_name test-fll_status_string +build_name test-fl_status_string version_major 0 version_minor 7 @@ -23,7 +23,7 @@ build_indexer_arguments rcs build_language c build_libraries -lc -lcmocka -build_libraries-individual -lf_compare -lf_conversion -lf_memory -lf_parse -lf_status_string -lf_string -lf_utf -lfll_status_string +build_libraries-individual -lf_compare -lf_conversion -lf_memory -lf_parse -lf_status_string -lf_string -lf_utf -lfl_status_string build_sources_program test-status_string-from.c build_sources_program test-status_string.c diff --git a/level_2/fll_status_string/data/build/testfile b/level_1/fl_status_string/data/build/testfile similarity index 100% rename from level_2/fll_status_string/data/build/testfile rename to level_1/fl_status_string/data/build/testfile diff --git a/level_2/fll_status_string/tests/unit/c/test-status_string-from.c b/level_1/fl_status_string/tests/unit/c/test-status_string-from.c similarity index 94% rename from level_2/fll_status_string/tests/unit/c/test-status_string-from.c rename to level_1/fl_status_string/tests/unit/c/test-status_string-from.c index 6607be4..976a91d 100644 --- a/level_2/fll_status_string/tests/unit/c/test-status_string-from.c +++ b/level_1/fl_status_string/tests/unit/c/test-status_string-from.c @@ -5,7 +5,7 @@ extern "C" { #endif -void test__fll_status_string_from__fails(void **state) { +void test__fl_status_string_from__fails(void **state) { f_string_static_t invalids[] = { macro_f_string_static_t_initialize("X&87-", 0, 5), @@ -17,33 +17,33 @@ void test__fll_status_string_from__fails(void **state) { f_status_t result = F_none; - const f_status_t status = fll_status_string_from(invalids[i], &result); + const f_status_t status = fl_status_string_from(invalids[i], &result); assert_int_equal(status, F_status_set_error(F_data)); } // for } -void test__fll_status_string_from__parameter_checking(void **state) { +void test__fl_status_string_from__parameter_checking(void **state) { { - const f_status_t status = fll_status_string_from(f_string_empty_s, 0); + const f_status_t status = fl_status_string_from(f_string_empty_s, 0); assert_int_equal(F_status_set_fine(status), F_parameter); } } -void test__fll_status_string_from__returns_data_not(void **state) { +void test__fl_status_string_from__returns_data_not(void **state) { { f_status_t result = F_none; - const f_status_t status = fll_status_string_from(f_string_empty_s, &result); + const f_status_t status = fl_status_string_from(f_string_empty_s, &result); assert_int_equal(status, F_data_not); } } -void test__fll_status_string_from__works(void **state) { +void test__fl_status_string_from__works(void **state) { const f_status_t statuss[] = { F_false, @@ -123,12 +123,16 @@ void test__fll_status_string_from__works(void **state) { F_ascii_not, F_atomic, F_atomic_not, + F_base, + F_base_not, F_begin, F_begin_not, F_block, F_block_not, F_body, F_body_not, + F_bottom, + F_bottom_not, F_bound, F_bound_not, F_break, @@ -137,6 +141,8 @@ void test__fll_status_string_from__works(void **state) { F_call_not, F_capability, F_capability_not, + F_character, + F_character_not, F_child, F_child_not, F_complete, @@ -207,6 +213,8 @@ void test__fll_status_string_from__works(void **state) { F_failure_not, F_family, F_family_not, + F_fifo, + F_fifo_not, F_first, F_first_not, F_footer, @@ -260,6 +268,8 @@ void test__fll_status_string_from__works(void **state) { F_memory_not, F_message, F_message_not, + F_middle, + F_middle_not, F_minor, F_minor_not, F_moderate, @@ -323,6 +333,8 @@ void test__fll_status_string_from__works(void **state) { F_recover_not, F_recurse, F_recurse_not, + F_regular, + F_regular_not, F_relative, F_relative_not, F_remote, @@ -369,7 +381,7 @@ void test__fll_status_string_from__works(void **state) { F_string_too_small, F_success, F_success_not, - F_supported, + F_support, F_support_not, F_syntax, F_syntax_not, @@ -382,6 +394,8 @@ void test__fll_status_string_from__works(void **state) { F_time_out, F_too_large, F_too_small, + F_top, + F_top_not, F_type, F_type_not, F_user, @@ -488,12 +502,14 @@ void test__fll_status_string_from__works(void **state) { F_complete_not_utf_eof, F_complete_not_utf_eol, F_complete_not_utf_eos, + F_complete_not_utf_start, F_complete_not_utf_stop, F_none_block, F_none_eoa, F_none_eof, F_none_eol, F_none_eos, + F_none_start, F_none_stop, F_data, F_data_not, @@ -502,6 +518,7 @@ void test__fll_status_string_from__works(void **state) { F_data_not_eof, F_data_not_eol, F_data_not_eos, + F_data_not_start, F_data_not_stop, F_end, F_end_not, @@ -516,6 +533,7 @@ void test__fll_status_string_from__works(void **state) { F_end_not_group_eof, F_end_not_group_eol, F_end_not_group_eos, + F_end_not_group_start, F_end_not_group_stop, F_end_not_nest, F_end_not_nest_block, @@ -523,7 +541,9 @@ void test__fll_status_string_from__works(void **state) { F_end_not_nest_eof, F_end_not_nest_eol, F_end_not_nest_eos, + F_end_not_nest_start, F_end_not_nest_stop, + F_end_not_start, F_end_not_stop, F_process, F_process_not, @@ -590,7 +610,7 @@ void test__fll_status_string_from__works(void **state) { F_directory_purge, F_directory_read, F_directory_stream, - F_directory_supported_not, + F_directory_support_not, F_directory_synchronize, F_directory_utf, F_directory_utf_not, @@ -717,12 +737,16 @@ void test__fll_status_string_from__works(void **state) { f_status_ascii_not_s, f_status_atomic_s, f_status_atomic_not_s, + f_status_base_s, + f_status_base_not_s, f_status_begin_s, f_status_begin_not_s, f_status_block_s, f_status_block_not_s, f_status_body_s, f_status_body_not_s, + f_status_bottom_s, + f_status_bottom_not_s, f_status_bound_s, f_status_bound_not_s, f_status_break_s, @@ -731,6 +755,8 @@ void test__fll_status_string_from__works(void **state) { f_status_call_not_s, f_status_capability_s, f_status_capability_not_s, + f_status_character_s, + f_status_character_not_s, f_status_child_s, f_status_child_not_s, f_status_complete_s, @@ -801,6 +827,8 @@ void test__fll_status_string_from__works(void **state) { f_status_failure_not_s, f_status_family_s, f_status_family_not_s, + f_status_fifo_s, + f_status_fifo_not_s, f_status_first_s, f_status_first_not_s, f_status_footer_s, @@ -854,6 +882,8 @@ void test__fll_status_string_from__works(void **state) { f_status_memory_not_s, f_status_message_s, f_status_message_not_s, + f_status_middle_s, + f_status_middle_not_s, f_status_minor_s, f_status_minor_not_s, f_status_moderate_s, @@ -917,6 +947,8 @@ void test__fll_status_string_from__works(void **state) { f_status_recover_not_s, f_status_recurse_s, f_status_recurse_not_s, + f_status_regular_s, + f_status_regular_not_s, f_status_relative_s, f_status_relative_not_s, f_status_remote_s, @@ -963,8 +995,8 @@ void test__fll_status_string_from__works(void **state) { f_status_string_too_small_s, f_status_success_s, f_status_success_not_s, - f_status_supported_s, - f_status_supported_not_s, + f_status_support_s, + f_status_support_not_s, f_status_syntax_s, f_status_syntax_not_s, f_status_terminate_s, @@ -976,6 +1008,8 @@ void test__fll_status_string_from__works(void **state) { f_status_time_out_s, f_status_too_large_s, f_status_too_small_s, + f_status_top_s, + f_status_top_not_s, f_status_type_s, f_status_type_not_s, f_status_user_s, @@ -1082,12 +1116,14 @@ void test__fll_status_string_from__works(void **state) { f_status_complete_not_utf_eof_s, f_status_complete_not_utf_eol_s, f_status_complete_not_utf_eos_s, + f_status_complete_not_utf_start_s, f_status_complete_not_utf_stop_s, f_status_none_block_s, f_status_none_eoa_s, f_status_none_eof_s, f_status_none_eol_s, f_status_none_eos_s, + f_status_none_start_s, f_status_none_stop_s, f_status_data_s, f_status_data_not_s, @@ -1096,6 +1132,7 @@ void test__fll_status_string_from__works(void **state) { f_status_data_not_eof_s, f_status_data_not_eol_s, f_status_data_not_eos_s, + f_status_data_not_start_s, f_status_data_not_stop_s, f_status_end_s, f_status_end_not_s, @@ -1110,6 +1147,7 @@ void test__fll_status_string_from__works(void **state) { f_status_end_not_group_eof_s, f_status_end_not_group_eol_s, f_status_end_not_group_eos_s, + f_status_end_not_group_start_s, f_status_end_not_group_stop_s, f_status_end_not_nest_s, f_status_end_not_nest_block_s, @@ -1117,7 +1155,9 @@ void test__fll_status_string_from__works(void **state) { f_status_end_not_nest_eof_s, f_status_end_not_nest_eol_s, f_status_end_not_nest_eos_s, + f_status_end_not_nest_start_s, f_status_end_not_nest_stop_s, + f_status_end_not_start_s, f_status_end_not_stop_s, f_status_process_s, f_status_process_not_s, @@ -1184,7 +1224,7 @@ void test__fll_status_string_from__works(void **state) { f_status_directory_purge_s, f_status_directory_read_s, f_status_directory_stream_s, - f_status_directory_supported_not_s, + f_status_directory_support_not_s, f_status_directory_synchronize_s, f_status_directory_utf_s, f_status_directory_utf_not_s, @@ -1233,11 +1273,11 @@ void test__fll_status_string_from__works(void **state) { f_status_status_code_last_s, }; - for (uint16_t i = 0; i < 591; ++i) { + for (uint16_t i = 0; i < 611; ++i) { f_status_t result = F_none; - const f_status_t status = fll_status_string_from(status_strings[i], &result); + const f_status_t status = fl_status_string_from(status_strings[i], &result); assert_int_equal(status, F_none); assert_int_equal(result, statuss[i]); diff --git a/level_1/fl_status_string/tests/unit/c/test-status_string-from.h b/level_1/fl_status_string/tests/unit/c/test-status_string-from.h new file mode 100644 index 0000000..4574f7e --- /dev/null +++ b/level_1/fl_status_string/tests/unit/c/test-status_string-from.h @@ -0,0 +1,41 @@ +/** + * FLL - Level 1 + * + * Project: Status + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Test the status_string project. + */ +#ifndef _TEST__FL_status_string_from_h +#define _TEST__FL_status_string_from_h + +/** + * Test that function fails. + * + * @see fl_status_string_from() + */ +extern void test__fl_status_string_from__fails(void **state); + +/** + * Test that parameter checking works as expected. + * + * @see fl_status_string_from() + */ +extern void test__fl_status_string_from__parameter_checking(void **state); + +/** + * Test that function returns F_data_not. + * + * @see fl_status_string_from() + */ +extern void test__fl_status_string_from__returns_data_not(void **state); + +/** + * Test that function works. + * + * @see fl_status_string_from() + */ +extern void test__fl_status_string_from__works(void **state); + +#endif // _TEST__FL_status_string_from_h diff --git a/level_2/fll_status_string/tests/unit/c/test-status_string.c b/level_1/fl_status_string/tests/unit/c/test-status_string.c similarity index 62% rename from level_2/fll_status_string/tests/unit/c/test-status_string.c rename to level_1/fl_status_string/tests/unit/c/test-status_string.c index c92ea1f..c1fdf2b 100644 --- a/level_2/fll_status_string/tests/unit/c/test-status_string.c +++ b/level_1/fl_status_string/tests/unit/c/test-status_string.c @@ -20,12 +20,12 @@ int main(void) { const struct CMUnitTest tests[] = { - cmocka_unit_test(test__fll_status_string_from__fails), - cmocka_unit_test(test__fll_status_string_from__returns_data_not), - cmocka_unit_test(test__fll_status_string_from__works), + cmocka_unit_test(test__fl_status_string_from__fails), + cmocka_unit_test(test__fl_status_string_from__returns_data_not), + cmocka_unit_test(test__fl_status_string_from__works), #ifndef _di_level_0_parameter_checking_ - cmocka_unit_test(test__fll_status_string_from__parameter_checking), + cmocka_unit_test(test__fl_status_string_from__parameter_checking), #endif // _di_level_0_parameter_checking_ }; diff --git a/level_2/fll_status_string/tests/unit/c/test-status_string.h b/level_1/fl_status_string/tests/unit/c/test-status_string.h similarity index 83% rename from level_2/fll_status_string/tests/unit/c/test-status_string.h rename to level_1/fl_status_string/tests/unit/c/test-status_string.h index a46716d..69a7005 100644 --- a/level_2/fll_status_string/tests/unit/c/test-status_string.h +++ b/level_1/fl_status_string/tests/unit/c/test-status_string.h @@ -1,5 +1,5 @@ /** - * FLL - Level 2 + * FLL - Level 1 * * Project: Status * API Version: 0.7 @@ -7,8 +7,8 @@ * * Test the status_string project. */ -#ifndef _TEST__FLL_status_string_h -#define _TEST__FLL_status_string_h +#ifndef _TEST__FL_status_string_h +#define _TEST__FL_status_string_h // Libc includes. #include @@ -19,8 +19,8 @@ // cmocka includes. #include -// FLL-2 includes. -#include +// FLL-1 includes. +#include // Mock includes. @@ -68,4 +68,4 @@ extern int main(void); } // extern "C" #endif -#endif // _TEST__FLL_status_string_h +#endif // _TEST__FL_status_string_h diff --git a/level_2/fll_fss_status_string/c/fss_status_string.c b/level_2/fll_fss_status_string/c/fss_status_string.c index d882ff3..1613fe8 100644 --- a/level_2/fll_fss_status_string/c/fss_status_string.c +++ b/level_2/fll_fss_status_string/c/fss_status_string.c @@ -39,20 +39,13 @@ extern "C" { f_status_t status = F_none; - if (!name.used) { - return F_data_not; - } + if (!name.used) return F_data_not; // Numbers are not valid status code strings. status = f_conversion_character_is_decimal(name.string[0]); - if (status == F_true) { - return F_status_set_error(F_data); - } - - if (F_status_is_error(status)) { - return status; - } + if (status == F_true) return F_status_set_error(F_data); + if (F_status_is_error(status)) return status; #ifndef _di_fll_fss_status_error_ if (f_compare_dynamic(name, fll_fss_status_format_s) == F_equal_to) { @@ -134,7 +127,7 @@ extern "C" { return F_none; } - return F_status_set_error(F_data); + return fl_status_string_from(name, code); } #endif // _di_fll_fss_status_string_from_ @@ -209,7 +202,7 @@ extern "C" { return F_none; } -#endif // _di_fll_status_string_to_ +#endif // _di_fl_status_string_to_ #ifdef __cplusplus } // extern "C" diff --git a/level_2/fll_fss_status_string/c/fss_status_string.h b/level_2/fll_fss_status_string/c/fss_status_string.h index 99cc815..34585a4 100644 --- a/level_2/fll_fss_status_string/c/fss_status_string.h +++ b/level_2/fll_fss_status_string/c/fss_status_string.h @@ -22,6 +22,9 @@ #include #include +// FLL-1 includes. +#include + #ifdef __cplusplus extern "C" { #endif @@ -107,6 +110,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * * Errors (with error bit) from: f_conversion_character_is_decimal(). + * Errors (with error bit) from: fl_status_string_from(). + * + * @see fl_status_string_from() */ #ifndef _di_fll_fss_status_string_from_ extern f_status_t fll_fss_status_string_from(const f_string_static_t name, f_status_t * const code); diff --git a/level_2/fll_fss_status_string/data/build/dependencies b/level_2/fll_fss_status_string/data/build/dependencies index 3b80ae1..08085bc 100644 --- a/level_2/fll_fss_status_string/data/build/dependencies +++ b/level_2/fll_fss_status_string/data/build/dependencies @@ -10,3 +10,4 @@ f_conversion f_fss f_parse f_status_string +fl_status_string diff --git a/level_2/fll_fss_status_string/data/build/settings b/level_2/fll_fss_status_string/data/build/settings index 9f5b892..93fe52c 100644 --- a/level_2/fll_fss_status_string/data/build/settings +++ b/level_2/fll_fss_status_string/data/build/settings @@ -18,7 +18,7 @@ build_indexer_arguments rcs build_language c build_libraries -lc -build_libraries-individual -lf_compare -lf_conversion -lf_fss -lf_parse -lf_memory -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual -lfl_status_string -lf_compare -lf_conversion -lf_fss -lf_parse -lf_memory -lf_status_string -lf_string -lf_type_array -lf_utf build_sources_library fss_status_string.c diff --git a/level_2/fll_status_string/tests/unit/c/test-status_string-from.h b/level_2/fll_status_string/tests/unit/c/test-status_string-from.h deleted file mode 100644 index f071e85..0000000 --- a/level_2/fll_status_string/tests/unit/c/test-status_string-from.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * FLL - Level 2 - * - * Project: Status - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Test the status_string project. - */ -#ifndef _TEST__FLL_status_string_from_h -#define _TEST__FLL_status_string_from_h - -/** - * Test that function fails. - * - * @see fll_status_string_from() - */ -extern void test__fll_status_string_from__fails(void **state); - -/** - * Test that parameter checking works as expected. - * - * @see fll_status_string_from() - */ -extern void test__fll_status_string_from__parameter_checking(void **state); - -/** - * Test that function returns F_data_not. - * - * @see fll_status_string_from() - */ -extern void test__fll_status_string_from__returns_data_not(void **state); - -/** - * Test that function works. - * - * @see fll_status_string_from() - */ -extern void test__fll_status_string_from__works(void **state); - -#endif // _TEST__FLL_status_string_from_h diff --git a/level_3/control/c/control.h b/level_3/control/c/control.h index 19c7fff..ec77cc7 100644 --- a/level_3/control/c/control.h +++ b/level_3/control/c/control.h @@ -41,6 +41,7 @@ #include #include #include +#include // FLL-2 includes. #include @@ -49,7 +50,6 @@ #include #include #include -#include // Control includes. #include diff --git a/level_3/control/c/private-control.c b/level_3/control/c/private-control.c index b4ff763..ee72d49 100644 --- a/level_3/control/c/private-control.c +++ b/level_3/control/c/private-control.c @@ -501,7 +501,7 @@ extern "C" { memcpy(name_string, data->cache.large.string + data->cache.header_contents.array[i].array[0].start, name_length); name_string[name_length] = 0; - status = fll_status_string_from(name, &header->status); + status = fl_status_string_from(name, &header->status); if (F_status_is_error(status)) { control_print_debug_packet_message(main, "Failed to process %[" CONTROL_status_s "%] in the response packet, Content is:", &data->cache.large, &data->cache.header_contents.array[i].array[0], &status); diff --git a/level_3/control/c/private-control.h b/level_3/control/c/private-control.h index c5fd006..b663dc9 100644 --- a/level_3/control/c/private-control.h +++ b/level_3/control/c/private-control.h @@ -119,9 +119,9 @@ extern "C" { * @see f_string_dynamic_increase_by() * @see fl_conversion_dynamic_partial_to_unsigned_detect() * @see f_fss_apply_delimit() + * @see fl_status_string_from() * @see fll_fss_extended_read() * @see fll_fss_basic_list_read() - * @see fll_status_string_from() */ #ifndef _di_control_packet_receive_ extern f_status_t control_packet_receive(const fll_program_data_t * const main, control_data_t * const data, control_payload_header_t * const header) F_attribute_visibility_internal_d; diff --git a/level_3/control/data/build/settings b/level_3/control/data/build/settings index 9cb90d7..0d94979 100644 --- a/level_3/control/data/build/settings +++ b/level_3/control/data/build/settings @@ -18,7 +18,7 @@ build_indexer_arguments rcs build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program -lfll_status_string -lfl_conversion -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_socket -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_fss -lfl_print -lfl_status_string -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_socket -lf_status_string -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll diff --git a/level_3/controller/c/controller.h b/level_3/controller/c/controller.h index 0faa89f..ba50e7d 100644 --- a/level_3/controller/c/controller.h +++ b/level_3/controller/c/controller.h @@ -63,6 +63,7 @@ #include #include #include +#include // FLL-2 includes. #include @@ -75,7 +76,6 @@ #include #include #include -#include // Controller includes. #include diff --git a/level_3/status_code/c/main/common/type.h b/level_3/status_code/c/main/common/type.h index ee2bbff..36cdd04 100644 --- a/level_3/status_code/c/main/common/type.h +++ b/level_3/status_code/c/main/common/type.h @@ -26,7 +26,7 @@ extern "C" { * * state: The state information. * - * status_string_from: A pointer to the status string function (usually either fll_status_string_from() or fll_fss_status_string_from()). + * status_string_from: A pointer to the status string function (usually either fl_status_string_from() or fll_fss_status_string_from()). * status_string_to: A pointer to the status string function (usually either f_status_string_to() or fll_fss_status_string_to()). * status_string_help_detail: Print additional, more detailed help, in the help page. */ diff --git a/level_3/status_code/c/main/main.c b/level_3/status_code/c/main/main.c index 6bfd985..f620de6 100644 --- a/level_3/status_code/c/main/main.c +++ b/level_3/status_code/c/main/main.c @@ -17,7 +17,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { data.setting.program_name = &status_code_program_name_s; data.setting.program_name_long = &status_code_program_name_long_s; - data.setting.status_string_from = &fll_status_string_from; + data.setting.status_string_from = &fl_status_string_from; data.setting.status_string_to = &f_status_string_to; data.setting.status_string_help_detail = &status_code_print_message_help_detail; diff --git a/level_3/status_code/c/main/process.h b/level_3/status_code/c/main/process.h index de1a000..c441bcb 100644 --- a/level_3/status_code/c/main/process.h +++ b/level_3/status_code/c/main/process.h @@ -54,12 +54,12 @@ extern "C" { * F_data_not if string is empty. * * Errors (with error bit) from: fl_console_parameter_to_number_unsigned(). + * Errors (with error bit) from: fl_status_string_from(). * Errors (with error bit) from: fll_fss_status_string_to(). - * Errors (with error bit) from: fll_status_string_from(). * * @see fl_console_parameter_to_number_unsigned() + * @see fl_status_string_from() * @see fll_fss_status_string_from() - * @see fll_status_string_from() */ #ifndef _di_status_code_process_number_ extern void status_code_process_number(status_code_main_t * const main, const f_string_static_t value); diff --git a/level_3/status_code/c/main/status_code.h b/level_3/status_code/c/main/status_code.h index 80c8832..6b178e8 100644 --- a/level_3/status_code/c/main/status_code.h +++ b/level_3/status_code/c/main/status_code.h @@ -35,12 +35,12 @@ // FLL-1 includes. #include #include +#include // FLL-2 includes. #include #include #include -#include // Status Code includes. #include diff --git a/level_3/status_code/data/build/dependencies b/level_3/status_code/data/build/dependencies index 92785d8..fdefc9c 100644 --- a/level_3/status_code/data/build/dependencies +++ b/level_3/status_code/data/build/dependencies @@ -26,6 +26,7 @@ f_status_string fl_conversion fl_directory fl_print +fl_status_string fll_error fll_print diff --git a/level_3/status_code/data/build/dependencies.fss b/level_3/status_code/data/build/dependencies.fss index c352f86..229b424 100644 --- a/level_3/status_code/data/build/dependencies.fss +++ b/level_3/status_code/data/build/dependencies.fss @@ -28,6 +28,7 @@ fl_conversion fl_directory fl_fss fl_print +fl_status_string fll_error fll_fss_status_string diff --git a/level_3/status_code/data/build/settings b/level_3/status_code/data/build/settings index 0196f1a..45c8e9b 100644 --- a/level_3/status_code/data/build/settings +++ b/level_3/status_code/data/build/settings @@ -21,7 +21,7 @@ build_indexer_arguments rcs build_language c build_libraries -lc -build_libraries-individual -lfll_error -lfll_print -lfll_program -lfll_status_string -lfl_conversion -lfl_directory -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_print -lfl_status_string -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll diff --git a/level_3/status_code/data/build/settings.fss b/level_3/status_code/data/build/settings.fss index 4c8935d..657f192 100644 --- a/level_3/status_code/data/build/settings.fss +++ b/level_3/status_code/data/build/settings.fss @@ -22,7 +22,7 @@ build_indexer_arguments rcs build_language c build_libraries -lc -lstatus_code -build_libraries-individual -lfll_error -lfll_fss_status_string -lfll_print -lfll_program -lfll_status_string -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual -lfll_error -lfll_fss_status_string -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status_string -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll diff --git a/level_3/status_code/data/build/settings.main b/level_3/status_code/data/build/settings.main index 68e49c3..d9b5768 100644 --- a/level_3/status_code/data/build/settings.main +++ b/level_3/status_code/data/build/settings.main @@ -22,7 +22,7 @@ build_indexer_arguments rcs build_language c build_libraries -lc -lstatus_code -build_libraries-individual -lfll_error -lfll_print -lfll_program -lfll_status_string -lfl_conversion -lfl_directory -lfl_print -lf_color -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_print -lfl_status_string -lf_color -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -- 1.8.3.1