whole_disc: inject a variant the reader never produces in the propagation test

This commit is contained in:
Matthew Jackson
2026-09-29 19:01:50 -07:00
parent 0f6e183808
commit d7183b4de8
2 changed files with 3 additions and 15 deletions
Generated
-12
View File
@@ -850,15 +850,3 @@ dependencies = [
"log",
"simd-adler32",
]
[[patch.unused]]
name = "freemkv-engine"
version = "1.7.7"
[[patch.unused]]
name = "freemkv-i18n"
version = "1.7.7"
[[patch.unused]]
name = "freemkv-keysources"
version = "1.7.7"
+3 -3
View File
@@ -176,17 +176,17 @@ fn unit_aligned_widens_reads_onto_each_files_grid() {
#[test]
fn unit_aligned_propagates_inner_read_errors_on_both_paths() {
let mut r = reader(vec![(100, 30, 100)]);
r.inner.fail = Some(|| Error::DecryptFailed);
r.inner.fail = Some(|| Error::Halted);
let mut buf = vec![0u8; 3 * 2048];
// Outside every span: plain read path.
assert!(matches!(
r.read_sectors(10, 3, &mut buf, false),
Err(Error::DecryptFailed)
Err(Error::Halted)
));
// Inside a span: unit-widened path.
assert!(matches!(
r.read_sectors(101, 3, &mut buf, false),
Err(Error::DecryptFailed)
Err(Error::Halted)
));
assert_eq!(r.inner.reads, vec![(10, 3), (100, 6)]);
}