Skip to content

test(coverage): add and expand host unit tests for CPIO, FDT, Virtio-Blk, and Duration (#260) - #270

Merged
marcobuschini merged 1 commit into
257-issue-increase-host-unit-test-line-and-branch-coverage-toward-100from
260-subissue-3-increase-coverage-for-cpio-fdt-virtio-blk-and-duration-from-257
Dec 4, 2026
Merged

marcobuschini merged 1 commit into
257-issue-increase-host-unit-test-line-and-branch-coverage-toward-100from
260-subissue-3-increase-coverage-for-cpio-fdt-virtio-blk-and-duration-from-257

Conversation

@marcobuschini

@marcobuschini marcobuschini commented Dec 4, 2026 •

Copy link
Copy Markdown
Member
  • Add tests/host/cpio_duration_test.cpp covering CpioArchive, cpio_lookup(), malformed archive error paths, and Duration conversions
  • Expand tests/host/fdt_test.cpp to cover header validation, memory regions, reservations, initrd bounds, fw_cfg, and cell/interrupt edge cases
  • Expand tests/host/virtio_blk_test.cpp for bind_from_bus(), error paths, multi-chunk I/O, deferred IRQ polling, and MMIO_INTERRUPT_ACK checks
  • Register cpio_duration_test.cpp and virtio_blk_test.cpp in Makefile, raising target coverage to 92% lines / 77% branches

Verification & Quality Gates

  • make all builds cleanly under aarch64-linux-gnu-g++ (-std=c++20 -Werror)
  • make quality passes format-check, lint-report (clang-tidy), and test-host
  • make test-host passes Snitch unit tests under ASan/UBSan with zero PFA/heap leaks
  • Verified in QEMU (make run) where applicable

Checklist

  • PR title and commits follow Conventional Commits / Commitizen specification
  • Changes adhere to freestanding C++20 rules (no exceptions, RTTI, or banned headers)
  • Changes stay strictly within the scope of the linked issue/sub-issue

…Blk, and Duration (#260)

- Add `tests/host/cpio_duration_test.cpp` covering `CpioArchive`,
  `cpio_lookup()`, malformed archive error paths, and `Duration` conversions
- Expand `tests/host/fdt_test.cpp` to cover header validation, memory regions,
  reservations, initrd bounds, `fw_cfg`, and cell/interrupt edge cases
- Expand `tests/host/virtio_blk_test.cpp` for `bind_from_bus()`, error paths,
  multi-chunk I/O, deferred IRQ polling, and `MMIO_INTERRUPT_ACK` checks
- Register `cpio_duration_test.cpp` and `virtio_blk_test.cpp` in `Makefile`,
  raising target coverage to 92% lines / 77% branches
@marcobuschini marcobuschini self-assigned this Dec 4, 2026
@marcobuschini
marcobuschini merged commit 14639db into 257-issue-increase-host-unit-test-line-and-branch-coverage-toward-100 Dec 4, 2026
5 checks passed
@marcobuschini
marcobuschini deleted the 260-subissue-3-increase-coverage-for-cpio-fdt-virtio-blk-and-duration-from-257 branch December 4, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant