()
| 3969 | |
| 3970 | #[test] |
| 3971 | fn rebuild_refcounts() { |
| 3972 | with_basic_file(&valid_header_v3(), |mut disk_file: RawFile| { |
| 3973 | let header = QcowHeader::new(&mut disk_file).expect("Failed to create Header."); |
| 3974 | let cluster_size = 65536; |
| 3975 | let refcount_bits = 1u64 << header.refcount_order; |
| 3976 | let mut raw_file = QcowRawFile::from(disk_file, cluster_size, refcount_bits) |
| 3977 | .expect("Failed to create QcowRawFile."); |
| 3978 | QcowFile::rebuild_refcounts(&mut raw_file, header) |
| 3979 | .expect("Failed to rebuild recounts."); |
| 3980 | }); |
| 3981 | } |
| 3982 | |
| 3983 | // Helper to create a v3 header with specific incompatible feature bits set |
| 3984 | fn header_v3_with_incompat_features(features: u64) -> Vec<u8> { |
no test coverage detected