From: Kevin Day Date: Mon, 19 Aug 2024 03:21:29 +0000 (-0500) Subject: Update: Unit tests for FSS Embedded Read. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=0bd187b0b5e130dae843657ec282b402dec8924f;p=fll Update: Unit tests for FSS Embedded Read. I forgot to update the unit tests in commit 104ed789a759a344146431ded54cde9fefb063ec. --- diff --git a/level_1/fl_fss/tests/unit/c/test-fss-embedded_list_content_read.c b/level_1/fl_fss/tests/unit/c/test-fss-embedded_list_content_read.c index 93bf996..57c5030 100644 --- a/level_1/fl_fss/tests/unit/c/test-fss-embedded_list_content_read.c +++ b/level_1/fl_fss/tests/unit/c/test-fss-embedded_list_content_read.c @@ -12,6 +12,13 @@ void test__fl_fss_embedded_list_content_read__parameter_checking(void **void_sta f_ranges_t comments = f_ranges_t_initialize; f_number_unsigneds_t delimits = f_number_unsigneds_t_initialize; + f_ranges_t objects = f_ranges_t_initialize; + f_number_unsigneds_t positions = f_number_unsigneds_t_initialize; + f_number_unsigneds_t slashes = f_number_unsigneds_t_initialize; + fl_fss_data_embedded_list_t cache = macro_fl_fss_data_embedded_list_t_initialize_1(&objects, &positions, &slashes); + + state.data = (void *) &cache; + { state.status = F_none; @@ -115,6 +122,10 @@ void test__fl_fss_embedded_list_content_read__parameter_checking(void **void_sta assert_int_equal(state.status, F_status_set_error(F_parameter)); } + + if (objects.array) free(objects.array); + if (positions.array) free(positions.array); + if (slashes.array) free(slashes.array); } void test__fl_fss_embedded_list_content_read__returns_data_not(void **void_state) { @@ -125,6 +136,13 @@ void test__fl_fss_embedded_list_content_read__returns_data_not(void **void_state f_ranges_t comments = f_ranges_t_initialize; f_number_unsigneds_t delimits = f_number_unsigneds_t_initialize; + f_ranges_t objects = f_ranges_t_initialize; + f_number_unsigneds_t positions = f_number_unsigneds_t_initialize; + f_number_unsigneds_t slashes = f_number_unsigneds_t_initialize; + fl_fss_data_embedded_list_t cache = macro_fl_fss_data_embedded_list_t_initialize_1(&objects, &positions, &slashes); + + state.data = (void *) &cache; + { state.status = F_none; @@ -132,6 +150,10 @@ void test__fl_fss_embedded_list_content_read__returns_data_not(void **void_state assert_int_equal(state.status, F_data_not); } + + if (objects.array) free(objects.array); + if (positions.array) free(positions.array); + if (slashes.array) free(slashes.array); } void test__fl_fss_embedded_list_content_read__works(void **void_state) { @@ -201,6 +223,13 @@ void test__fl_fss_embedded_list_content_read__works(void **void_state) { f_string_dynamic_t delimit_string = f_string_dynamic_t_initialize; f_status_t status_object = F_okay; + f_ranges_t objects = f_ranges_t_initialize; + f_number_unsigneds_t positions = f_number_unsigneds_t_initialize; + f_number_unsigneds_t slashes = f_number_unsigneds_t_initialize; + fl_fss_data_embedded_list_t cache = macro_fl_fss_data_embedded_list_t_initialize_1(&objects, &positions, &slashes); + + state.data = (void *) &cache; + for (;;) { max = 255; @@ -307,6 +336,10 @@ void test__fl_fss_embedded_list_content_read__works(void **void_state) { if (result_string.string) free(result_string.string); if (delimit_string.string) free(delimit_string.string); + if (objects.array) free(objects.array); + if (positions.array) free(positions.array); + if (slashes.array) free(slashes.array); + f_fss_nest_delete(&found); } }