Skip to content

[SUBISSUE #3] Increase Coverage for CPIO, FDT, Virtio-Blk, and Duration #260

Done

Description

@marcobuschini

Parent issue: #257

Baseline

  • kernel/fs/cpio.cpp: 12.8% lines (6/47), 18.6% branches
  • kernel/drivers/virtio/virtio_blk.cpp: 21.6% lines (46/213), 17.5% branches
  • kernel/boot/fdt.cpp: 30.8% lines (186/603), 25.8% branches
  • kernel/time/Duration.hpp: 42.1% lines (16/38), 12.5% branches

Scope

Expand existing host snitch tests (tests/host/fdt_test.cpp, tests/host/virtio_blk_test.cpp, and new tests/host/cpio_duration_test.cpp):

  • cpio.cpp: cpio_lookup, cpio_for_each, malformed magic/trailer/truncated-header error branches, symlinks and directories
  • fdt.cpp: malformed DTB headers, memreserve, chosen/initrd bounds, reg/interrupts parsing edge cases
  • virtio_blk.cpp: read_sectors/write_sectors error/status paths, geometry checks, flush/IRQ completion branches
  • Duration.hpp: from_ns/from_us/from_ms/from_secs, saturation/overflow, arithmetic & comparison operators

Acceptance Criteria

  • Line and branch coverage for cpio.cpp, fdt.cpp, virtio_blk.cpp, and Duration.hpp raised to >= 85% lines / >= 75% branches.
  • make clean-tests && make -j"$(nproc)" quality passes with zero warnings or ASan/UBSan errors.

Metadata

Metadata

Assignees

Labels

subissue

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions