Found while verifying #55 (fixing eboot_core's build). These are two
separate, pre-existing, unrelated problems in the test suite — real, but each is
a larger undertaking than a quick fix, so filing them here rather than folding
them into that PR.
tests/unit/test_slot_manager.c — ~20 test functions called but never defined
PR #37 rewrote this file's fixture (old SLOT_A_ADDR/parse_result[]/ASSERT/RUN
style → new sim_flash/slot_states[]/PASS() style) to support new boot-attempt/
rollback tests. The patch was applied incompletely:
- Symbols the surviving old code still references (
slot_index, SLOT_A_ADDR,
SLOT_SIZE, erase_result) were deleted.
- New content was spliced into the middle of an existing function body rather than
replacing it cleanly — eos_image_parse_header()'s body is truncated mid-statement,
and the very next line starts a new function definition inside its still-open
brace, which is illegal in C (error: function definition is not allowed here,
repeated for every function after it).
- The new
main() calls roughly twenty test functions (test_scan_one_valid_slot,
test_slot_is_valid_empty, test_slot_erase, test_version_macro_encoding, …)
that don't exist anywhere in the file — only their names appear in the call list.
Reproduce:
$ cc -fsyntax-only -x c -I include tests/unit/test_slot_manager.c
# 20 errors, starting with "use of undeclared identifier 'SLOT_B_ADDR'"
Fixing this properly means writing ~20 real test bodies against
eos_slot_manager.h's actual API — new test authorship, not a restoration.
tests/unit/test_boot_log.c — duplicate-symbol conflict with the real implementation
This file defines its own local mock of eos_boot_log_read() with a different
signature than the real one in core/boot_log.c ((entries, max_count) vs.
(index, out) — see #55 for why the header was corrected to match the real
implementation). But its CMake target also links the full eboot_core library,
which includes the real core/boot_log.c. That means even with a header fix,
this file redefines a symbol that's also present in the library it links against
— a duplicate-symbol conflict, not a simple signature mismatch. It needs a real
redesign (either drop the local mock and use the real implementation with a fake
HAL backend, or rename the mock), not a one-line fix.
Reproduce (after #55 is merged, since before that the header itself was also
wrong and masked this):
$ cmake --build build --target test_boot_log
# core/ed25519_verify.c:434: error: conflicting types for 'eos_boot_log_read'
Not investigated further
I didn't audit whether other test files have the same class of damage as
test_slot_manager.c — I found these two while trying to get eboot_core's own
tests running, not via a systematic sweep. Worth a broader look.
Found while verifying #55 (fixing
eboot_core's build). These are twoseparate, pre-existing, unrelated problems in the test suite — real, but each is
a larger undertaking than a quick fix, so filing them here rather than folding
them into that PR.
tests/unit/test_slot_manager.c— ~20 test functions called but never definedPR #37 rewrote this file's fixture (old
SLOT_A_ADDR/parse_result[]/ASSERT/RUNstyle → new
sim_flash/slot_states[]/PASS()style) to support new boot-attempt/rollback tests. The patch was applied incompletely:
slot_index,SLOT_A_ADDR,SLOT_SIZE,erase_result) were deleted.replacing it cleanly —
eos_image_parse_header()'s body is truncated mid-statement,and the very next line starts a new function definition inside its still-open
brace, which is illegal in C (
error: function definition is not allowed here,repeated for every function after it).
main()calls roughly twenty test functions (test_scan_one_valid_slot,test_slot_is_valid_empty,test_slot_erase,test_version_macro_encoding, …)that don't exist anywhere in the file — only their names appear in the call list.
Reproduce:
Fixing this properly means writing ~20 real test bodies against
eos_slot_manager.h's actual API — new test authorship, not a restoration.tests/unit/test_boot_log.c— duplicate-symbol conflict with the real implementationThis file defines its own local mock of
eos_boot_log_read()with a differentsignature than the real one in
core/boot_log.c((entries, max_count)vs.(index, out)— see #55 for why the header was corrected to match the realimplementation). But its CMake target also links the full
eboot_corelibrary,which includes the real
core/boot_log.c. That means even with a header fix,this file redefines a symbol that's also present in the library it links against
— a duplicate-symbol conflict, not a simple signature mismatch. It needs a real
redesign (either drop the local mock and use the real implementation with a fake
HAL backend, or rename the mock), not a one-line fix.
Reproduce (after #55 is merged, since before that the header itself was also
wrong and masked this):
Not investigated further
I didn't audit whether other test files have the same class of damage as
test_slot_manager.c— I found these two while trying to geteboot_core's owntests running, not via a systematic sweep. Worth a broader look.