MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / test_compressed_read

Function test_compressed_read

block/src/qcow_sync.rs:1819–1838  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1817
1818 #[test]
1819 fn test_compressed_read() {
1820 let cluster_size = 65536usize;
1821 let data: Vec<u8> = (0..=255).cycle().take(cluster_size).collect();
1822 let (temp, disk) = create_disk_with_data(100 * 1024 * 1024, &data, 0, false, false);
1823 drop(disk);
1824
1825 compress_allocated_clusters(&mut temp.as_file().try_clone().unwrap());
1826
1827 let disk = QcowDisk::new(
1828 temp.as_file().try_clone().unwrap(),
1829 false,
1830 false,
1831 false,
1832 false,
1833 )
1834 .unwrap();
1835
1836 let buf = async_read(&disk, 0, cluster_size);
1837 assert_eq!(buf, data);
1838 }
1839}

Callers

nothing calls this directly

Calls 6

newFunction · 0.85
takeMethod · 0.80
create_disk_with_dataFunction · 0.70
async_readFunction · 0.70
try_cloneMethod · 0.45

Tested by

no test coverage detected