From 2fe79eeaa5f1ae5623f6323d632dd91496346715 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 7 Mar 2025 23:30:20 -0600 Subject: [PATCH] Feature: Add F_test status codes. These codes are notably useful during the unit and runtime testing. --- level_0/f_status/c/status.h | 2 ++ level_0/f_status_string/c/status_string.c | 12 ++++++++++++ level_0/f_status_string/c/status_string.h | 6 ++++++ level_0/f_status_string/tests/unit/c/test-status_string-to.c | 6 +++++- level_1/fl_status_string/c/status_string.c | 12 ++++++++++++ .../fl_status_string/tests/unit/c/test-status_string-from.c | 6 +++++- 6 files changed, 42 insertions(+), 2 deletions(-) diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index e129cb8..70aecbf 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -519,6 +519,8 @@ extern "C" { F_syntax_not, F_terminate, F_terminate_not, + F_test, + F_test_not, F_thread, F_thread_not, F_time, diff --git a/level_0/f_status_string/c/status_string.c b/level_0/f_status_string/c/status_string.c index a0955ed..96af3cb 100644 --- a/level_0/f_status_string/c/status_string.c +++ b/level_0/f_status_string/c/status_string.c @@ -383,6 +383,8 @@ extern "C" { const f_string_static_t f_status_syntax_not_s = macro_f_string_static_t_initialize_1(F_status_syntax_not_s, 0, F_status_syntax_not_s_length); const f_string_static_t f_status_terminate_s = macro_f_string_static_t_initialize_1(F_status_terminate_s, 0, F_status_terminate_s_length); const f_string_static_t f_status_terminate_not_s = macro_f_string_static_t_initialize_1(F_status_terminate_not_s, 0, F_status_terminate_not_s_length); + const f_string_static_t f_status_test_s = macro_f_string_static_t_initialize_1(F_status_test_s, 0, F_status_test_s_length); + const f_string_static_t f_status_test_not_s = macro_f_string_static_t_initialize_1(F_status_test_not_s, 0, F_status_test_not_s_length); const f_string_static_t f_status_thread_s = macro_f_string_static_t_initialize_1(F_status_thread_s, 0, F_status_thread_s_length); const f_string_static_t f_status_thread_not_s = macro_f_string_static_t_initialize_1(F_status_thread_not_s, 0, F_status_thread_not_s_length); const f_string_static_t f_status_time_s = macro_f_string_static_t_initialize_1(F_status_time_s, 0, F_status_time_s_length); @@ -2594,6 +2596,16 @@ extern "C" { break; + case F_test: + *name = f_status_test_s; + + break; + + case F_test_not: + *name = f_status_test_not_s; + + break; + case F_thread: *name = f_status_thread_s; diff --git a/level_0/f_status_string/c/status_string.h b/level_0/f_status_string/c/status_string.h index 90c3db9..87f62c7 100644 --- a/level_0/f_status_string/c/status_string.h +++ b/level_0/f_status_string/c/status_string.h @@ -543,6 +543,8 @@ extern "C" { #define F_status_syntax_not_s "F_syntax_not" #define F_status_terminate_s "F_terminate" #define F_status_terminate_not_s "F_terminate_not" + #define F_status_test_s "F_test" + #define F_status_test_not_s "F_test_not" #define F_status_thread_s "F_thread" #define F_status_thread_not_s "F_thread_not" #define F_status_time_s "F_time" @@ -899,6 +901,8 @@ extern "C" { #define F_status_syntax_not_s_length 12 #define F_status_terminate_s_length 11 #define F_status_terminate_not_s_length 15 + #define F_status_test_s_length 6 + #define F_status_test_not_s_length 10 #define F_status_thread_s_length 8 #define F_status_thread_not_s_length 12 #define F_status_time_s_length 6 @@ -1249,6 +1253,8 @@ extern "C" { extern const f_string_static_t f_status_syntax_not_s; extern const f_string_static_t f_status_terminate_s; extern const f_string_static_t f_status_terminate_not_s; + extern const f_string_static_t f_status_test_s; + extern const f_string_static_t f_status_test_not_s; extern const f_string_static_t f_status_thread_s; extern const f_string_static_t f_status_thread_not_s; extern const f_string_static_t f_status_time_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 95a7081..15c93e0 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 @@ -413,6 +413,8 @@ void test__f_status_string_to__works(void **state) { F_syntax_not, F_terminate, F_terminate_not, + F_test, + F_test_not, F_thread, F_thread_not, F_time, @@ -1070,6 +1072,8 @@ void test__f_status_string_to__works(void **state) { f_status_syntax_not_s, f_status_terminate_s, f_status_terminate_not_s, + f_status_test_s, + f_status_test_not_s, f_status_thread_s, f_status_thread_not_s, f_status_time_s, @@ -1343,7 +1347,7 @@ void test__f_status_string_to__works(void **state) { f_status_status_code_last_s, }; - for (uint16_t i = 0; i < 650; ++i) { + for (uint16_t i = 0; i < 652; ++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 cdc8b65..42f9e5b 100644 --- a/level_1/fl_status_string/c/status_string.c +++ b/level_1/fl_status_string/c/status_string.c @@ -2319,6 +2319,18 @@ extern "C" { return F_okay; } + if (f_compare_dynamic(name, f_status_test_s) == F_equal_to) { + *code = F_test; + + return F_okay; + } + + if (f_compare_dynamic(name, f_status_test_not_s) == F_equal_to) { + *code = F_test_not; + + return F_okay; + } + if (f_compare_dynamic(name, f_status_thread_s) == F_equal_to) { *code = F_thread; 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 dc81326..939ed23 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 @@ -429,6 +429,8 @@ void test__fl_status_string_from__works(void **state) { F_syntax_not, F_terminate, F_terminate_not, + F_test, + F_test_not, F_thread, F_thread_not, F_time, @@ -1086,6 +1088,8 @@ void test__fl_status_string_from__works(void **state) { f_status_syntax_not_s, f_status_terminate_s, f_status_terminate_not_s, + f_status_test_s, + f_status_test_not_s, f_status_thread_s, f_status_thread_not_s, f_status_time_s, @@ -1359,7 +1363,7 @@ void test__fl_status_string_from__works(void **state) { f_status_status_code_last_s, }; - for (uint16_t i = 0; i < 650; ++i) { + for (uint16_t i = 0; i < 652; ++i) { f_status_t result = F_okay; -- 1.8.3.1