(file_size: u64, direct: bool, mut testfn: F)
| 2435 | } |
| 2436 | |
| 2437 | fn with_default_file<F>(file_size: u64, direct: bool, mut testfn: F) |
| 2438 | where |
| 2439 | F: FnMut(QcowFile), |
| 2440 | { |
| 2441 | let tmp: RawFile = RawFile::new(TempFile::new().unwrap().into_file(), direct); |
| 2442 | let qcow_file = QcowFile::new(tmp, 3, file_size, true).unwrap(); |
| 2443 | |
| 2444 | testfn(qcow_file); // File closed when the function exits. |
| 2445 | } |
| 2446 | |
| 2447 | #[test] |
| 2448 | fn write_read_start_backing_v2() { |