Files
RedBear-OS/drivers/storage
Red Bear OS 1606a6ffb2 USB: P1 usbscsid SCSI buffer invariant tests
IMPROVEMENT-PLAN.md §10.1: validates P0 .unwrap→.expect safety fix.

4 tests validating the buffer size invariants documented in
the scsi/mod.rs SAFETY comment:

- all_command_structs_fit_in_command_buffer:
  Verifies Inquiry, ModeSense6/10, RequestSense, ReadCapacity10,
  Read16, Write16 all fit within the 16-byte command_buffer

- standard_inquiry_data_fits_in_inquiry_buffer:
  Verifies StandardInquiryData (36 bytes) fits in inquiry_buffer (259)

- response_structs_match_expected_sizes:
  Verifies ModeParamHeader6 (4), ModeParamHeader10 (8),
  ReadCapacity10ParamData (8) fixed sizes

- plain_from_bytes_is_safe_for_buffers:
  Round-trip verifies plain::from_bytes succeeds on properly
  sized buffers — validates that the .expect() calls in the
  res_* methods will never panic

All 4 tests pass. usbscsid now has 4 tests (was 0).
2026-07-08 13:37:04 +03:00
..