From a5f0b30a3c6948d4ca4f5c13312eb573b34c1038 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 9 Jul 2023 11:33:16 -0500 Subject: [PATCH] Update: Add F_network_version_four, F_network_version_four_not, F_network_version_six, and F_network_version_six_not status codes. The IPv4 and IPv6 situation is common enough to merit explicit status codes. --- level_0/f_status/c/status.h | 4 ++++ level_0/f_status_string/c/status_string.c | 24 ++++++++++++++++++++++ level_0/f_status_string/c/status_string.h | 12 +++++++++++ .../tests/unit/c/test-status_string-to.c | 10 ++++++++- level_1/fl_status_string/c/status_string.c | 24 ++++++++++++++++++++++ .../tests/unit/c/test-status_string-from.c | 10 ++++++++- 6 files changed, 82 insertions(+), 2 deletions(-) diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index 7fa7b55..dccfa64 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -582,6 +582,10 @@ extern "C" { F_network_server_not, F_network_time, F_network_time_not, + F_network_version_four, + F_network_version_four_not, + F_network_version_six, + F_network_version_six_not, #endif // _di_f_status_network_e_ #ifndef _di_f_status_number_e_ diff --git a/level_0/f_status_string/c/status_string.c b/level_0/f_status_string/c/status_string.c index 370f1fa..6ee1e08 100644 --- a/level_0/f_status_string/c/status_string.c +++ b/level_0/f_status_string/c/status_string.c @@ -456,6 +456,10 @@ extern "C" { const f_string_static_t f_status_network_server_not_s = macro_f_string_static_t_initialize_1(F_status_network_server_not_s, 0, F_status_network_server_not_s_length); const f_string_static_t f_status_network_time_s = macro_f_string_static_t_initialize_1(F_status_network_time_s, 0, F_status_network_time_s_length); const f_string_static_t f_status_network_time_not_s = macro_f_string_static_t_initialize_1(F_status_network_time_not_s, 0, F_status_network_time_not_s_length); + const f_string_static_t f_status_network_version_four_s = macro_f_string_static_t_initialize_1(F_status_network_version_four_s, 0, F_status_network_version_four_s_length); + const f_string_static_t f_status_network_version_four_not_s = macro_f_string_static_t_initialize_1(F_status_network_version_four_not_s, 0, F_status_network_version_four_not_s_length); + const f_string_static_t f_status_network_version_six_s = macro_f_string_static_t_initialize_1(F_status_network_version_six_s, 0, F_status_network_version_six_s_length); + const f_string_static_t f_status_network_version_six_not_s = macro_f_string_static_t_initialize_1(F_status_network_version_six_not_s, 0, F_status_network_version_six_not_s_length); #endif // _di_f_status_network_s_ #ifndef _di_f_status_number_s_ @@ -2841,6 +2845,26 @@ extern "C" { *name = f_status_network_time_not_s; break; + + case F_network_version_four: + *name = f_status_network_version_four_s; + + break; + + case F_network_version_four_not: + *name = f_status_network_version_four_not_s; + + break; + + case F_network_version_six: + *name = f_status_network_version_six_s; + + break; + + case F_network_version_six_not: + *name = f_status_network_version_six_not_s; + + break; #endif // _di_f_status_network_s_ #ifndef _di_f_status_number_s_ diff --git a/level_0/f_status_string/c/status_string.h b/level_0/f_status_string/c/status_string.h index 47a71de..5be2fe1 100644 --- a/level_0/f_status_string/c/status_string.h +++ b/level_0/f_status_string/c/status_string.h @@ -1303,6 +1303,10 @@ extern "C" { #define F_status_network_server_not_s "F_network_server_not" #define F_status_network_time_s "F_network_time" #define F_status_network_time_not_s "F_network_time_not" + #define F_status_network_version_four_s "F_network_version_four" + #define F_status_network_version_four_not_s "F_network_version_four_not" + #define F_status_network_version_six_s "F_network_version_six" + #define F_status_network_version_six_not_s "F_network_version_six_not" #define F_status_network_s_length 9 #define F_status_network_busy_s_length 14 @@ -1326,6 +1330,10 @@ extern "C" { #define F_status_network_server_not_s_length 20 #define F_status_network_time_s_length 14 #define F_status_network_time_not_s_length 18 + #define F_status_network_version_four_s_length 22 + #define F_status_network_version_four_not_s_length 26 + #define F_status_network_version_six_s_length 21 + #define F_status_network_version_six_not_s_length 25 extern const f_string_static_t f_status_network_s; extern const f_string_static_t f_status_network_busy_s; @@ -1349,6 +1357,10 @@ extern "C" { extern const f_string_static_t f_status_network_server_not_s; extern const f_string_static_t f_status_network_time_s; extern const f_string_static_t f_status_network_time_not_s; + extern const f_string_static_t f_status_network_version_four_s; + extern const f_string_static_t f_status_network_version_four_not_s; + extern const f_string_static_t f_status_network_version_six_s; + extern const f_string_static_t f_status_network_version_six_not_s; #endif // _di_f_status_network_s_ #ifndef _di_f_status_number_s_ diff --git a/level_0/f_status_string/tests/unit/c/test-status_string-to.c b/level_0/f_status_string/tests/unit/c/test-status_string-to.c index 4b89db7..6d7da00 100644 --- a/level_0/f_status_string/tests/unit/c/test-status_string-to.c +++ b/level_0/f_status_string/tests/unit/c/test-status_string-to.c @@ -459,6 +459,10 @@ void test__f_status_string_to__works(void **state) { F_network_server_not, F_network_time, F_network_time_not, + F_network_version_four, + F_network_version_four_not, + F_network_version_six, + F_network_version_six_not, F_number, F_number_decimal, F_number_decimal_not, @@ -1075,6 +1079,10 @@ void test__f_status_string_to__works(void **state) { f_status_network_server_not_s, f_status_network_time_s, f_status_network_time_not_s, + f_status_network_version_four_s, + f_status_network_version_four_not_s, + f_status_network_version_six_s, + f_status_network_version_six_not_s, f_status_number_s, f_status_number_decimal_s, f_status_number_decimal_not_s, @@ -1261,7 +1269,7 @@ void test__f_status_string_to__works(void **state) { f_status_status_code_last_s, }; - for (uint16_t i = 0; i < 613; ++i) { + for (uint16_t i = 0; i < 617; ++i) { f_string_static_t result = f_string_static_t_initialize; diff --git a/level_1/fl_status_string/c/status_string.c b/level_1/fl_status_string/c/status_string.c index 95900c9..9485b26 100644 --- a/level_1/fl_status_string/c/status_string.c +++ b/level_1/fl_status_string/c/status_string.c @@ -2606,6 +2606,30 @@ extern "C" { return F_none; } + + if (f_compare_dynamic(name, f_status_network_version_four_s) == F_equal_to) { + *code = F_network_version_four; + + return F_none; + } + + if (f_compare_dynamic(name, f_status_network_version_four_not_s) == F_equal_to) { + *code = F_network_version_four_not; + + return F_none; + } + + if (f_compare_dynamic(name, f_status_network_version_six_s) == F_equal_to) { + *code = F_network_version_six; + + return F_none; + } + + if (f_compare_dynamic(name, f_status_network_version_six_not_s) == F_equal_to) { + *code = F_network_version_six_not; + + return F_none; + } #endif // _di_f_status_network_s_ #ifndef _di_f_status_number_s_ diff --git a/level_1/fl_status_string/tests/unit/c/test-status_string-from.c b/level_1/fl_status_string/tests/unit/c/test-status_string-from.c index f201747..8e4f1fb 100644 --- a/level_1/fl_status_string/tests/unit/c/test-status_string-from.c +++ b/level_1/fl_status_string/tests/unit/c/test-status_string-from.c @@ -475,6 +475,10 @@ void test__fl_status_string_from__works(void **state) { F_network_server_not, F_network_time, F_network_time_not, + F_network_version_four, + F_network_version_four_not, + F_network_version_six, + F_network_version_six_not, F_number, F_number_decimal, F_number_decimal_not, @@ -1091,6 +1095,10 @@ void test__fl_status_string_from__works(void **state) { f_status_network_server_not_s, f_status_network_time_s, f_status_network_time_not_s, + f_status_network_version_four_s, + f_status_network_version_four_not_s, + f_status_network_version_six_s, + f_status_network_version_six_not_s, f_status_number_s, f_status_number_decimal_s, f_status_number_decimal_not_s, @@ -1277,7 +1285,7 @@ void test__fl_status_string_from__works(void **state) { f_status_status_code_last_s, }; - for (uint16_t i = 0; i < 613; ++i) { + for (uint16_t i = 0; i < 617; ++i) { f_status_t result = F_none; -- 1.8.3.1