]> Kevux Git Server - fll/commitdiff
Bugfix: The f_directory_status bad macro and a failing unit test.
authorKevin Day <Kevin@kevux.org>
Sun, 25 Oct 2026 04:10:40 +0000 (23:10 -0500)
committerKevin Day <Kevin@kevux.org>
Sun, 25 Oct 2026 04:10:40 +0000 (23:10 -0500)
The `macro_f_directory_status_t_initialize_1()` is using `status_value` and `path_value` as the parameters within it but is defining them as `status` and `path`.
Fix this by setting them to `status_value` and `path_value`.

The unit test is improperly initializing them.
How did this test not fail in the past?
It just suddenly started failing.
I'll leave that as a fluke.
It is going that the tests caught it and this fixes it.

level_0/f_directory/c/directory/status.h
level_0/f_directory/tests/unit/c/test-directory-statuss_delete_callback.c

index 2149f2f6d8b692d97c3a725bdd2bffb280889306..871e317762bfca842a7a629a2726e92734985b89 100644 (file)
@@ -36,7 +36,7 @@ extern "C" {
     .path   = f_string_dynamic_t_initialize, \
   }
 
-  #define macro_f_directory_status_t_initialize_1(status, path) { \
+  #define macro_f_directory_status_t_initialize_1(status_value, path_value) { \
     .status = status_value, \
     .path   = path_value, \
   }
index 839dcc5e15363c507d3d0e7b3824d6b6544227fb..6b6f4db4ad5be437f044db59cee7e816741fae29 100644 (file)
@@ -10,9 +10,10 @@ void test__f_directory_statuss_delete_callback__fails(void **state) {
   mock_unwrap = 0;
   mock_unwrap_f_memory = 0;
 
-  f_directory_status_t data = f_directory_status_t_initialize;
+  f_string_dynamic_t path = macro_f_string_dynamic_t_initialize_1("path", 4, 0);
+  f_directory_status_t data = macro_f_directory_status_t_initialize_1(F_okay, path);
   f_directory_status_t data_array[] = { data };
-  f_directory_statuss_t datas = { .array = data_array, .used = 1, .size = 1 };
+  f_directory_statuss_t datas = macro_f_directory_statuss_t_initialize_1(data_array, 1, 1);
   f_directory_statuss_t datass_array[] = { datas };
 
   {