Repository navigation
Description
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.
Activity
Aswin-V commentedon Oct 5, 2026
Verified fixed on master — closing as resolved.
test_slot_manager.c: the damage described here (truncated
eos_image_parse_headerbody, ~20 called-but-undefined test functions) is gone. The file is coherent: 9 tests againsteos_slot_manager.h's actual API, all defined,main()calls exactly the tests that exist. Built and ran the host target just now:test_boot_log.c: redesigned per this issue's suggestion — no more local
eos_boot_log_*mocks; it exercises the realcore/boot_log.cwith a stubbed flash/tick HAL. No duplicate-symbol conflict (linkseboot_corecleanly):The repairs landed via the post-#37 fixups (b0b2ab9 merge-regression repairs, the boot-log redesign). The reproduction steps in this issue no longer reproduce.