]> Kevux Git Server - fll/commitdiff
Update: Unit tests for FSS Embedded Read.
authorKevin Day <Kevin@kevux.org>
Mon, 19 Aug 2024 03:21:29 +0000 (22:21 -0500)
committerKevin Day <Kevin@kevux.org>
Mon, 19 Aug 2024 03:21:29 +0000 (22:21 -0500)
I forgot to update the unit tests in commit 104ed789a759a344146431ded54cde9fefb063ec.

level_1/fl_fss/tests/unit/c/test-fss-embedded_list_content_read.c

index 93bf996db58eb61182666874b9c5e2b0269e41c0..57c5030f69ba92648184bce877a7e2358fc6d1ae 100644 (file)
@@ -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);
   }
 }