From 891a1576b5e162176af61e7527ca3dcb50c7608b Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 2 Mar 2024 23:48:34 -0600 Subject: [PATCH] Progress: Add strings unit tests for fl_fss_payload_header_map(). --- level_1/fl_fss/data/build/settings-tests | 1 + .../headers/payload-join-abstruse_strings-0.txt | 7 +--- .../headers/payload-join-abstruse_strings-1.txt | 6 +-- .../headers/payload-join-abstruse_strings-2.txt | 5 +-- .../headers/payload-split-abstruse_strings-0.txt | 3 ++ .../headers/payload-split-abstruse_strings-1.txt | 3 ++ .../headers/payload-split-abstruse_strings-2.txt | 3 ++ .../tests/variables/payload-abstruse_strings.txt | 3 +- level_1/fl_fss/tests/unit/c/help-fss-payload.c | 4 +- level_1/fl_fss/tests/unit/c/help-fss-payload.h | 7 +++- ...t-fss-payload_header_map-abstruse_int16s-join.c | 4 +- ...t-fss-payload_header_map-abstruse_int16s-join.h | 7 +++- ...-fss-payload_header_map-abstruse_int16s-split.c | 4 +- ...-fss-payload_header_map-abstruse_int16s-split.h | 7 +++- ...t-fss-payload_header_map-abstruse_int32s-join.c | 4 +- ...t-fss-payload_header_map-abstruse_int32s-join.h | 7 +++- ...-fss-payload_header_map-abstruse_int32s-split.c | 4 +- ...-fss-payload_header_map-abstruse_int32s-split.h | 7 +++- ...t-fss-payload_header_map-abstruse_int64s-join.c | 4 +- ...t-fss-payload_header_map-abstruse_int64s-join.h | 7 +++- ...-fss-payload_header_map-abstruse_int64s-split.c | 4 +- ...-fss-payload_header_map-abstruse_int64s-split.h | 7 +++- ...st-fss-payload_header_map-abstruse_int8s-join.c | 4 +- ...st-fss-payload_header_map-abstruse_int8s-join.h | 7 +++- ...t-fss-payload_header_map-abstruse_int8s-split.c | 4 +- ...t-fss-payload_header_map-abstruse_int8s-split.h | 7 +++- ...t-fss-payload_header_map-abstruse_signed-join.c | 4 +- ...t-fss-payload_header_map-abstruse_signed-join.h | 7 +++- ...-fss-payload_header_map-abstruse_signeds-join.c | 4 +- ...-fss-payload_header_map-abstruse_signeds-join.h | 7 +++- ...fss-payload_header_map-abstruse_signeds-split.c | 4 +- ...fss-payload_header_map-abstruse_signeds-split.h | 7 +++- ...t-fss-payload_header_map-abstruse_string-join.c | 4 +- ...t-fss-payload_header_map-abstruse_string-join.h | 7 +++- ...-fss-payload_header_map-abstruse_strings-join.c | 43 ++++++++++++++++++++++ ...-fss-payload_header_map-abstruse_strings-join.h | 37 +++++++++++++++++++ ...fss-payload_header_map-abstruse_strings-split.c | 43 ++++++++++++++++++++++ ...fss-payload_header_map-abstruse_strings-split.h | 37 +++++++++++++++++++ ...-fss-payload_header_map-abstruse_uint16s-join.c | 4 +- ...-fss-payload_header_map-abstruse_uint16s-join.h | 7 +++- ...fss-payload_header_map-abstruse_uint16s-split.c | 4 +- ...fss-payload_header_map-abstruse_uint16s-split.h | 7 +++- ...-fss-payload_header_map-abstruse_uint32s-join.c | 4 +- ...-fss-payload_header_map-abstruse_uint32s-join.h | 7 +++- ...fss-payload_header_map-abstruse_uint32s-split.c | 4 +- ...fss-payload_header_map-abstruse_uint32s-split.h | 7 +++- ...-fss-payload_header_map-abstruse_uint64s-join.c | 4 +- ...-fss-payload_header_map-abstruse_uint64s-join.h | 7 +++- ...fss-payload_header_map-abstruse_uint64s-split.c | 4 +- ...fss-payload_header_map-abstruse_uint64s-split.h | 7 +++- ...t-fss-payload_header_map-abstruse_uint8s-join.c | 4 +- ...t-fss-payload_header_map-abstruse_uint8s-join.h | 7 +++- ...-fss-payload_header_map-abstruse_uint8s-split.c | 4 +- ...-fss-payload_header_map-abstruse_uint8s-split.h | 7 +++- ...fss-payload_header_map-abstruse_unsigned-join.c | 4 +- ...fss-payload_header_map-abstruse_unsigned-join.h | 7 +++- ...ss-payload_header_map-abstruse_unsigneds-join.c | 4 +- ...ss-payload_header_map-abstruse_unsigneds-join.h | 7 +++- ...s-payload_header_map-abstruse_unsigneds-split.c | 4 +- ...s-payload_header_map-abstruse_unsigneds-split.h | 7 +++- level_1/fl_fss/tests/unit/c/test-fss.c | 3 +- level_1/fl_fss/tests/unit/c/test-fss.h | 2 + 62 files changed, 351 insertions(+), 109 deletions(-) create mode 100644 level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-0.txt create mode 100644 level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-1.txt create mode 100644 level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-2.txt create mode 100644 level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-join.c create mode 100644 level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-join.h create mode 100644 level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-split.c create mode 100644 level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-split.h diff --git a/level_1/fl_fss/data/build/settings-tests b/level_1/fl_fss/data/build/settings-tests index 8e5330c..096964d 100644 --- a/level_1/fl_fss/data/build/settings-tests +++ b/level_1/fl_fss/data/build/settings-tests @@ -43,6 +43,7 @@ build_sources_program test-fss-payload_header_map-abstruse_signed-join.c test-fs build_sources_program test-fss-payload_header_map-abstruse_signeds-join.c test-fss-payload_header_map-abstruse_unsigneds-join.c build_sources_program test-fss-payload_header_map-abstruse_signeds-split.c test-fss-payload_header_map-abstruse_unsigneds-split.c build_sources_program test-fss-payload_header_map-abstruse_string-join.c +build_sources_program test-fss-payload_header_map-abstruse_strings-join.c test-fss-payload_header_map-abstruse_strings-split.c build_sources_program test-fss.c data-fss.c help-fss.c help-fss-payload.c diff --git a/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-0.txt b/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-0.txt index 7b06942..2547b5e 100644 --- a/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-0.txt +++ b/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-0.txt @@ -1,6 +1,3 @@ a -4 -0 -hello -"some thing" -3全#$⸙ +1 +"0 hello some thing 3全#$⸙ """ diff --git a/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-1.txt b/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-1.txt index 50e859f..1cee3a3 100644 --- a/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-1.txt +++ b/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-1.txt @@ -1,5 +1,3 @@ b -3 -全 -⸙ -"␀ ␀ ␀ ␀ ␀ ␀" +1 +"全 ⸙ ␀ ␀ ␀ ␀ ␀ ␀" diff --git a/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-2.txt b/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-2.txt index 41f6980..f53932f 100644 --- a/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-2.txt +++ b/level_1/fl_fss/data/tests/headers/payload-join-abstruse_strings-2.txt @@ -1,4 +1,3 @@ c -2 -� -""a b \" c" +1 +"� "a b \" c" diff --git a/level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-0.txt b/level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-0.txt new file mode 100644 index 0000000..3cdfa1f --- /dev/null +++ b/level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-0.txt @@ -0,0 +1,3 @@ +a +1 +0 hello "some thing" 3全#$⸙ """" diff --git a/level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-1.txt b/level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-1.txt new file mode 100644 index 0000000..044ed3e --- /dev/null +++ b/level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-1.txt @@ -0,0 +1,3 @@ +b +1 +全 ⸙ "␀ ␀ ␀ ␀ ␀ ␀" diff --git a/level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-2.txt b/level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-2.txt new file mode 100644 index 0000000..64fa96d --- /dev/null +++ b/level_1/fl_fss/data/tests/headers/payload-split-abstruse_strings-2.txt @@ -0,0 +1,3 @@ +c +1 +� ""a b \" c" diff --git a/level_1/fl_fss/data/tests/variables/payload-abstruse_strings.txt b/level_1/fl_fss/data/tests/variables/payload-abstruse_strings.txt index d64b7e9..f4cdddb 100644 --- a/level_1/fl_fss/data/tests/variables/payload-abstruse_strings.txt +++ b/level_1/fl_fss/data/tests/variables/payload-abstruse_strings.txt @@ -1,9 +1,10 @@ a -4 +5 0 hello some thing 3全#$⸙ +"" b 3 全 diff --git a/level_1/fl_fss/tests/unit/c/help-fss-payload.c b/level_1/fl_fss/tests/unit/c/help-fss-payload.c index c1ad745..d99f675 100644 --- a/level_1/fl_fss/tests/unit/c/help-fss-payload.c +++ b/level_1/fl_fss/tests/unit/c/help-fss-payload.c @@ -4,7 +4,7 @@ extern "C" { #endif -void help_payload__test(const f_string_t context_variables, const f_string_t context_headers, const uint64_t flag, void (*load_contents)(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state)) { +void help_payload__test(const f_string_t context_variables, const f_string_t context_headers, const uint64_t flag, void (*load_contents)(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra), void * extra) { // Note: Each line should probably be at max 255 characters. // The payload begins with a digit on the first line representing the number of Content lines following the Object line. @@ -39,7 +39,7 @@ void help_payload__test(const f_string_t context_variables, const f_string_t con state.status = f_memory_array_increase(state.step_small, sizeof(f_abstruse_map_t), (void **) &headers.array, &headers.used, &headers.size); assert_true(F_status_is_error_not(state.status)); - load_contents(object, contents, &headers, &state); + load_contents(object, contents, &headers, &state, extra); if (object.string) free(object.string); diff --git a/level_1/fl_fss/tests/unit/c/help-fss-payload.h b/level_1/fl_fss/tests/unit/c/help-fss-payload.h index d189548..d64c31f 100644 --- a/level_1/fl_fss/tests/unit/c/help-fss-payload.h +++ b/level_1/fl_fss/tests/unit/c/help-fss-payload.h @@ -25,8 +25,13 @@ extern "C" { * The payload header state data flag. * @param load_contents * A callback to perform the type-specific content loading translation of the number. + * @param extra + * (optional) Additional argument of any type to pass to load_contents(). + * This is useful for when needing to free custom memory. + * Use a structure to pass multiple variables. + * Set to NULL to not use. */ -void help_payload__test(const f_string_t context_variables, const f_string_t context_headers, const uint64_t flag, void (*load_contents)(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state)); +void help_payload__test(const f_string_t context_variables, const f_string_t context_headers, const uint64_t flag, void (*load_contents)(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra), void * extra); #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-join.c index eca852c..2f390a7 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_int16s__works_join(void **void_state) { - help_payload__test("abstruse_int16s", "join-abstruse_int16s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_int16s__join_load_contents); + help_payload__test("abstruse_int16s", "join-abstruse_int16s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_int16s__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_int16s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_int16s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_int16s_t * const is_a = &headers->array[0].value.is.a_i16s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-join.h index f6fcd8e..14fcb24 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_int16s__works_join(void ** * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_int16s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_int16s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_int16s_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-split.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-split.c index 7c073bd..49d266b 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-split.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-split.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_int16s__works_split(void **void_state) { - help_payload__test("abstruse_int16s", "split-abstruse_int16s", 0, test__fl_fss_payload_header_map__abstruse_int16s__split_load_contents); + help_payload__test("abstruse_int16s", "split-abstruse_int16s", 0, test__fl_fss_payload_header_map__abstruse_int16s__split_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_int16s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_int16s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_int16s_t * const is_a = &headers->array[0].value.is.a_i16s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-split.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-split.h index 812af3c..fbb7b09 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-split.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int16s-split.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_int16s__works_split(void * * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_int16s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_int16s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_int16s_split_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-join.c index 1b47d60..81252d4 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_int32s__works_join(void **void_state) { - help_payload__test("abstruse_int32s", "join-abstruse_int32s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_int32s__join_load_contents); + help_payload__test("abstruse_int32s", "join-abstruse_int32s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_int32s__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_int32s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_int32s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_int32s_t * const is_a = &headers->array[0].value.is.a_i32s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-join.h index 398523e..cceccac 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_int32s__works_join(void ** * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_int32s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_int32s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_int32s_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-split.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-split.c index 6ccfa2f..b7e0cb5 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-split.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-split.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_int32s__works_split(void **void_state) { - help_payload__test("abstruse_int32s", "split-abstruse_int32s", 0, test__fl_fss_payload_header_map__abstruse_int32s__split_load_contents); + help_payload__test("abstruse_int32s", "split-abstruse_int32s", 0, test__fl_fss_payload_header_map__abstruse_int32s__split_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_int32s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_int32s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_int32s_t * const is_a = &headers->array[0].value.is.a_i32s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-split.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-split.h index b3dd588..0482169 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-split.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int32s-split.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_int32s__works_split(void * * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_int32s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_int32s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_int32s_split_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-join.c index bfd9649..3f8d4bc 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_int64s__works_join(void **void_state) { - help_payload__test("abstruse_int64s", "join-abstruse_int64s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_int64s__join_load_contents); + help_payload__test("abstruse_int64s", "join-abstruse_int64s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_int64s__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_int64s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_int64s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_int64s_t * const is_a = &headers->array[0].value.is.a_i64s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-join.h index df2ce19..0588255 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_int64s__works_join(void ** * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_int64s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_int64s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_int64s_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-split.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-split.c index 057caa7..d4fbf87 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-split.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-split.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_int64s__works_split(void **void_state) { - help_payload__test("abstruse_int64s", "split-abstruse_int64s", 0, test__fl_fss_payload_header_map__abstruse_int64s__split_load_contents); + help_payload__test("abstruse_int64s", "split-abstruse_int64s", 0, test__fl_fss_payload_header_map__abstruse_int64s__split_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_int64s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_int64s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_int64s_t * const is_a = &headers->array[0].value.is.a_i64s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-split.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-split.h index 20d33b7..626f995 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-split.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int64s-split.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_int64s__works_split(void * * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_int64s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_int64s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_int64s_split_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-join.c index 823de7a..6c9f9de 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_int8s__works_join(void **void_state) { - help_payload__test("abstruse_int8s", "join-abstruse_int8s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_int8s__join_load_contents); + help_payload__test("abstruse_int8s", "join-abstruse_int8s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_int8s__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_int8s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_int8s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_int8s_t * const is_a = &headers->array[0].value.is.a_i8s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-join.h index a8d1a05..85a220e 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_int8s__works_join(void **s * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_int8s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_int8s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_int8s_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-split.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-split.c index f49e3e6..2a7e81e 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-split.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-split.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_int8s__works_split(void **void_state) { - help_payload__test("abstruse_int8s", "split-abstruse_int8s", 0, test__fl_fss_payload_header_map__abstruse_int8s__split_load_contents); + help_payload__test("abstruse_int8s", "split-abstruse_int8s", 0, test__fl_fss_payload_header_map__abstruse_int8s__split_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_int8s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_int8s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_int8s_t * const is_a = &headers->array[0].value.is.a_i8s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-split.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-split.h index 41e9b98..35cc384 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-split.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_int8s-split.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_int8s__works_split(void ** * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_int8s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_int8s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_int8s_split_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signed-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signed-join.c index b34ee34..2e7acf4 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signed-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signed-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_signed__works_join(void **void_state) { - help_payload__test("abstruse_signed", "join-abstruse_signed", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_signed__join_load_contents); + help_payload__test("abstruse_signed", "join-abstruse_signed", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_signed__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_signed__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_signed__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { for (f_number_unsigned_t i = 0; i < contents.used; ++i, ++headers->used) { diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signed-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signed-join.h index 618e6e9..0699858 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signed-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signed-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_signed__works_join(void ** * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_signed__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_signed__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_signed_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-join.c index e9140db..50828d8 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_signeds__works_join(void **void_state) { - help_payload__test("abstruse_signeds", "join-abstruse_signeds", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_signeds__join_load_contents); + help_payload__test("abstruse_signeds", "join-abstruse_signeds", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_signeds__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_signeds__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_signeds__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_number_signeds_t * const is_a = &headers->array[0].value.is.a_signeds; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-join.h index c69539f..4f4169f 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_signeds__works_join(void * * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_signeds__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_signeds__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_signeds_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-split.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-split.c index 29b7a53..2a7e837 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-split.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-split.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_signeds__works_split(void **void_state) { - help_payload__test("abstruse_signeds", "split-abstruse_signeds", 0, test__fl_fss_payload_header_map__abstruse_signeds__split_load_contents); + help_payload__test("abstruse_signeds", "split-abstruse_signeds", 0, test__fl_fss_payload_header_map__abstruse_signeds__split_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_signeds__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_signeds__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_number_signeds_t * const is_a = &headers->array[0].value.is.a_signeds; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-split.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-split.h index 4989bab..1647a57 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-split.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_signeds-split.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_signeds__works_split(void * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_signeds__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_signeds__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_signeds_split_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_string-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_string-join.c index fefa7d2..1ab725e 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_string-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_string-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_string__works_join(void **void_state) { - help_payload__test("abstruse_string", "join-abstruse_string", 0, test__fl_fss_payload_header_map__abstruse_string__join_load_contents); + help_payload__test("abstruse_string", "join-abstruse_string", 0, test__fl_fss_payload_header_map__abstruse_string__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_string__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_string__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { for (f_number_unsigned_t i = 0; i < contents.used; ++i, ++headers->used) { diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_string-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_string-join.h index dcb7bed..22732fb 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_string-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_string-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_string__works_join(void ** * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_string__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_string__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_string_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-join.c new file mode 100644 index 0000000..07c3ed3 --- /dev/null +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-join.c @@ -0,0 +1,43 @@ +#include "test-fss.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__fl_fss_payload_header_map__abstruse_strings__works_join(void **void_state) { + + f_string_t *strings = 0; + + help_payload__test("abstruse_strings", "join-abstruse_strings", f_fss_payload_header_map_flag_join_strings_e, test__fl_fss_payload_header_map__abstruse_strings__join_load_contents, (void *) &strings); + + if (strings) free(strings); +} + +void test__fl_fss_payload_header_map__abstruse_strings__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { + + f_string_t **strings = (f_string_t **) extra; + + if (*strings) free(*strings); + + //headers->array[0].value.is.a_strings = calloc(contents.used + 1, sizeof(f_string_t *)); + //assert_int_not_equal(headers->array[0].value.is.a_strings, 0); + *strings = calloc(contents.used + 1, sizeof(f_string_t *)); + assert_int_not_equal(*strings, 0); + + headers->array[0].value.is.a_strings = *strings; + headers->array[0].key.used = 0; + headers->array[0].value.type = f_abstruse_strings_e; + + state->status = f_string_dynamic_append(object, &headers->array[headers->used].key); + assert_int_equal(state->status, F_okay); + + for (f_number_unsigned_t i = 0; i < contents.used; ++i) { + headers->array[0].value.is.a_strings[i] = contents.array[i].string; + } // for + + headers->array[0].value.is.a_strings[contents.used] = 0; +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-join.h new file mode 100644 index 0000000..6807863 --- /dev/null +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-join.h @@ -0,0 +1,37 @@ +/** + * FLL - Level 2 + * + * Project: FSS + * API Version: 0.6 + * Licenses: lgpl-2.1-or-later + * + * Test the fl_fss project. + */ +#ifndef _TEST__FL_fss_payload_header_map__abstruse_strings_join_h +#define _TEST__FL_fss_payload_header_map__abstruse_strings_join_h + +/** + * Test that the function works for abstruse_strings type. + * + * @see fl_fss_payload_header_map() + */ +extern void test__fl_fss_payload_header_map__abstruse_strings__works_join(void **state); + +/** + * Callback to load the contents for the test. + * + * @param object + * The object parameter. + * @param contents + * The contents parameter. + * @param headers + * The headers parameter. +* @param state + * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. + */ +extern void test__fl_fss_payload_header_map__abstruse_strings__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); + +#endif // _TEST__FL_fss_payload_header_map__abstruse_strings_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-split.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-split.c new file mode 100644 index 0000000..1c6d91c --- /dev/null +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-split.c @@ -0,0 +1,43 @@ +#include "test-fss.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__fl_fss_payload_header_map__abstruse_strings__works_split(void **void_state) { + + f_string_t *strings = 0; + + help_payload__test("abstruse_strings", "split-abstruse_strings", 0, test__fl_fss_payload_header_map__abstruse_strings__split_load_contents, (void *) &strings); + + if (strings) free(strings); +} + +void test__fl_fss_payload_header_map__abstruse_strings__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { + + f_string_t **strings = (f_string_t **) extra; + + if (*strings) free(*strings); + + //headers->array[0].value.is.a_strings = calloc(contents.used + 1, sizeof(f_string_t *)); + //assert_int_not_equal(headers->array[0].value.is.a_strings, 0); + *strings = calloc(contents.used + 1, sizeof(f_string_t *)); + assert_int_not_equal(*strings, 0); + + headers->array[0].value.is.a_strings = *strings; + headers->array[0].key.used = 0; + headers->array[0].value.type = f_abstruse_strings_e; + + state->status = f_string_dynamic_append(object, &headers->array[headers->used].key); + assert_int_equal(state->status, F_okay); + + for (f_number_unsigned_t i = 0; i < contents.used; ++i) { + headers->array[0].value.is.a_strings[i] = contents.array[i].string; + } // for + + headers->array[0].value.is.a_strings[contents.used] = 0; +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-split.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-split.h new file mode 100644 index 0000000..45ba0cf --- /dev/null +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_strings-split.h @@ -0,0 +1,37 @@ +/** + * FLL - Level 2 + * + * Project: FSS + * API Version: 0.6 + * Licenses: lgpl-2.1-or-later + * + * Test the fl_fss project. + */ +#ifndef _TEST__FL_fss_payload_header_map__abstruse_strings_split_h +#define _TEST__FL_fss_payload_header_map__abstruse_strings_split_h + +/** + * Test that the function works for abstruse_strings type. + * + * @see fl_fss_payload_header_map() + */ +extern void test__fl_fss_payload_header_map__abstruse_strings__works_split(void **state); + +/** + * Callback to load the contents for the test. + * + * @param object + * The object parameter. + * @param contents + * The contents parameter. + * @param headers + * The headers parameter. +* @param state + * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. + */ +extern void test__fl_fss_payload_header_map__abstruse_strings__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); + +#endif // _TEST__FL_fss_payload_header_map__abstruse_strings_split_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-join.c index 93de46f..529df2f 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_uint16s__works_join(void **void_state) { - help_payload__test("abstruse_uint16s", "join-abstruse_uint16s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_uint16s__join_load_contents); + help_payload__test("abstruse_uint16s", "join-abstruse_uint16s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_uint16s__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_uint16s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_uint16s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_uint16s_t * const is_a = &headers->array[0].value.is.a_u16s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-join.h index 116e06f..1b599b3 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_uint16s__works_join(void * * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_uint16s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_uint16s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_uint16s_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-split.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-split.c index bd5bdca..de58204 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-split.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-split.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_uint16s__works_split(void **void_state) { - help_payload__test("abstruse_uint16s", "split-abstruse_uint16s", 0, test__fl_fss_payload_header_map__abstruse_uint16s__split_load_contents); + help_payload__test("abstruse_uint16s", "split-abstruse_uint16s", 0, test__fl_fss_payload_header_map__abstruse_uint16s__split_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_uint16s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_uint16s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_uint16s_t * const is_a = &headers->array[0].value.is.a_u16s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-split.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-split.h index 666c1b7..d322507 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-split.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint16s-split.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_uint16s__works_split(void * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_uint16s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_uint16s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_uint16s_split_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-join.c index 485c364..dd51a2d 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_uint32s__works_join(void **void_state) { - help_payload__test("abstruse_uint32s", "join-abstruse_uint32s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_uint32s__join_load_contents); + help_payload__test("abstruse_uint32s", "join-abstruse_uint32s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_uint32s__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_uint32s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_uint32s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_uint32s_t * const is_a = &headers->array[0].value.is.a_u32s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-join.h index cf841ed..b87b372 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_uint32s__works_join(void * * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_uint32s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_uint32s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_uint32s_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-split.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-split.c index 481d40b..744bfc3 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-split.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-split.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_uint32s__works_split(void **void_state) { - help_payload__test("abstruse_uint32s", "split-abstruse_uint32s", 0, test__fl_fss_payload_header_map__abstruse_uint32s__split_load_contents); + help_payload__test("abstruse_uint32s", "split-abstruse_uint32s", 0, test__fl_fss_payload_header_map__abstruse_uint32s__split_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_uint32s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_uint32s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_uint32s_t * const is_a = &headers->array[0].value.is.a_u32s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-split.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-split.h index 1fe5106..c0b2324 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-split.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint32s-split.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_uint32s__works_split(void * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_uint32s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_uint32s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_uint32s_split_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-join.c index 73f100a..a91dfc9 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_uint64s__works_join(void **void_state) { - help_payload__test("abstruse_uint64s", "join-abstruse_uint64s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_uint64s__join_load_contents); + help_payload__test("abstruse_uint64s", "join-abstruse_uint64s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_uint64s__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_uint64s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_uint64s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_uint64s_t * const is_a = &headers->array[0].value.is.a_u64s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-join.h index 424f064..4a0ffe3 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_uint64s__works_join(void * * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_uint64s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_uint64s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_uint64s_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-split.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-split.c index 3683896..7f8faa1 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-split.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-split.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_uint64s__works_split(void **void_state) { - help_payload__test("abstruse_uint64s", "split-abstruse_uint64s", 0, test__fl_fss_payload_header_map__abstruse_uint64s__split_load_contents); + help_payload__test("abstruse_uint64s", "split-abstruse_uint64s", 0, test__fl_fss_payload_header_map__abstruse_uint64s__split_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_uint64s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_uint64s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_uint64s_t * const is_a = &headers->array[0].value.is.a_u64s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-split.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-split.h index 02fbafc..2f17af2 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-split.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint64s-split.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_uint64s__works_split(void * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_uint64s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_uint64s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_uint64s_split_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-join.c index f6a2a97..0254ab7 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_uint8s__works_join(void **void_state) { - help_payload__test("abstruse_uint8s", "join-abstruse_uint8s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_uint8s__join_load_contents); + help_payload__test("abstruse_uint8s", "join-abstruse_uint8s", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_uint8s__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_uint8s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_uint8s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_uint8s_t * const is_a = &headers->array[0].value.is.a_u8s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-join.h index 2d47f69..5969efa 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_uint8s__works_join(void ** * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_uint8s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_uint8s__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_uint8s_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-split.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-split.c index d8d7113..774cb7d 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-split.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-split.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_uint8s__works_split(void **void_state) { - help_payload__test("abstruse_uint8s", "split-abstruse_uint8s", 0, test__fl_fss_payload_header_map__abstruse_uint8s__split_load_contents); + help_payload__test("abstruse_uint8s", "split-abstruse_uint8s", 0, test__fl_fss_payload_header_map__abstruse_uint8s__split_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_uint8s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_uint8s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_uint8s_t * const is_a = &headers->array[0].value.is.a_u8s; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-split.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-split.h index e04fd8a..1bed8b0 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-split.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_uint8s-split.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_uint8s__works_split(void * * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_uint8s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_uint8s__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_uint8s_split_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigned-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigned-join.c index adfb87d..9ca6b3e 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigned-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigned-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_unsigned__works_join(void **void_state) { - help_payload__test("abstruse_unsigned", "join-abstruse_unsigned", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_unsigned__join_load_contents); + help_payload__test("abstruse_unsigned", "join-abstruse_unsigned", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_unsigned__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_unsigned__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_unsigned__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { for (f_number_unsigned_t i = 0; i < contents.used; ++i, ++headers->used) { diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigned-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigned-join.h index 8c04f95..68db3e6 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigned-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigned-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_unsigned__works_join(void * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_unsigned__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_unsigned__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_unsigned_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-join.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-join.c index 26b8743..47bcdfb 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-join.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-join.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_unsigneds__works_join(void **void_state) { - help_payload__test("abstruse_unsigneds", "join-abstruse_unsigneds", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_unsigneds__join_load_contents); + help_payload__test("abstruse_unsigneds", "join-abstruse_unsigneds", f_fss_payload_header_map_flag_join_digits_e, test__fl_fss_payload_header_map__abstruse_unsigneds__join_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_unsigneds__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_unsigneds__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_number_unsigneds_t * const is_a = &headers->array[0].value.is.a_unsigneds; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-join.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-join.h index 7586d0e..449fab7 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-join.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-join.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_unsigneds__works_join(void * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_unsigneds__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_unsigneds__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_unsigneds_join_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-split.c b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-split.c index 8c420a1..7e0f197 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-split.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-split.c @@ -6,10 +6,10 @@ extern "C" { void test__fl_fss_payload_header_map__abstruse_unsigneds__works_split(void **void_state) { - help_payload__test("abstruse_unsigneds", "split-abstruse_unsigneds", 0, test__fl_fss_payload_header_map__abstruse_unsigneds__split_load_contents); + help_payload__test("abstruse_unsigneds", "split-abstruse_unsigneds", 0, test__fl_fss_payload_header_map__abstruse_unsigneds__split_load_contents, 0); } -void test__fl_fss_payload_header_map__abstruse_unsigneds__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state) { +void test__fl_fss_payload_header_map__abstruse_unsigneds__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) { f_number_unsigneds_t * const is_a = &headers->array[0].value.is.a_unsigneds; diff --git a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-split.h b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-split.h index 2b3b3f2..0743042 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-split.h +++ b/level_1/fl_fss/tests/unit/c/test-fss-payload_header_map-abstruse_unsigneds-split.h @@ -26,9 +26,12 @@ extern void test__fl_fss_payload_header_map__abstruse_unsigneds__works_split(voi * The contents parameter. * @param headers * The headers parameter. - * @param state +* @param state * The state parameter. + * @param extra + * (optional) The extra parameter. + * Set to NULL to not use. */ -extern void test__fl_fss_payload_header_map__abstruse_unsigneds__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state); +extern void test__fl_fss_payload_header_map__abstruse_unsigneds__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra); #endif // _TEST__FL_fss_payload_header_map__abstruse_unsigneds_split_h diff --git a/level_1/fl_fss/tests/unit/c/test-fss.c b/level_1/fl_fss/tests/unit/c/test-fss.c index 329815c..703e254 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss.c +++ b/level_1/fl_fss/tests/unit/c/test-fss.c @@ -72,7 +72,8 @@ int main(void) { cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_signeds__works_join), cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_signeds__works_split), cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_string__works_join), - //cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_strings__works_join), + cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_strings__works_join), + cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_strings__works_split), cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_uint8s__works_join), cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_uint8s__works_split), cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_uint16s__works_join), diff --git a/level_1/fl_fss/tests/unit/c/test-fss.h b/level_1/fl_fss/tests/unit/c/test-fss.h index 53b443a..cac7fad 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss.h +++ b/level_1/fl_fss/tests/unit/c/test-fss.h @@ -74,6 +74,8 @@ #include "test-fss-payload_header_map-abstruse_signeds-join.h" #include "test-fss-payload_header_map-abstruse_signeds-split.h" #include "test-fss-payload_header_map-abstruse_string-join.h" +#include "test-fss-payload_header_map-abstruse_strings-join.h" +#include "test-fss-payload_header_map-abstruse_strings-split.h" #include "test-fss-payload_header_map-abstruse_uint8s-join.h" #include "test-fss-payload_header_map-abstruse_uint8s-split.h" #include "test-fss-payload_header_map-abstruse_uint16s-join.h" -- 1.8.3.1