refactor: stabilize heal format recovery integration tests (#1984)

Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
安正超
2026-02-27 15:26:19 +08:00
committed by GitHub
parent 3433dfa88e
commit 9d2b8822cf
26 changed files with 849 additions and 125 deletions
+10 -2
View File
@@ -248,8 +248,12 @@ impl ChecksumMode {
}
});
let c = self.base();
let crc_bytes = Vec::<u8>::with_capacity(p.len() * self.raw_byte_len() as usize);
let mut crc_bytes = Vec::<u8>::with_capacity(p.len() * self.raw_byte_len() as usize);
let mut h = self.hasher()?;
for part in p.iter() {
let part_checksum = part.checksum_raw(&c)?;
crc_bytes.extend(part_checksum);
}
h.update(crc_bytes.as_ref());
let hash = h.finalize();
Ok(Checksum {
@@ -260,7 +264,11 @@ impl ChecksumMode {
}
pub fn full_object_checksum(&self, p: &mut [ObjectPart]) -> Result<Checksum, std::io::Error> {
todo!();
if !self.can_merge_crc() {
return Err(std::io::Error::other("cannot do full-object checksum"));
}
self.composite_checksum(p)
}
}