Lines Matching refs:blk
960 let mut blk = TestBlockDeviceBuilder::new() in read_test_helper() localVariable
972 blk.read(case.rw_offset, out).unwrap(); in read_test_helper()
976 blk.io.storage in read_test_helper()
983 assert!(blk.io.num_reads <= READ_WRITE_BLOCKS_UPPER_BOUND); in read_test_helper()
988 let mut blk = TestBlockDeviceBuilder::new() in write_test_helper() localVariable
995 let mut expected = blk.io.storage in write_test_helper()
1007 write_func(&mut blk, case.rw_offset, data); in write_test_helper()
1011 blk.io.storage in write_test_helper()
1042 let func = |blk: &mut TestBlockDevice, offset: u64, data: &mut [u8]| {
1043 blk.write(offset, data).unwrap();
1044 assert!(blk.io.num_reads <= READ_WRITE_BLOCKS_UPPER_BOUND);
1045 assert!(blk.io.num_writes <= READ_WRITE_BLOCKS_UPPER_BOUND);
1055 let func = |blk: &mut TestBlockDevice, offset: u64, data: &mut [u8]| {
1056 blk.write(offset, data).unwrap();
1057 assert!(blk.io.num_reads <= READ_WRITE_BLOCKS_UPPER_BOUND);
1058 assert!(blk.io.num_writes <= READ_WRITE_BLOCKS_UPPER_BOUND);
1291 let mut blk = TestBlockDeviceBuilder::new() in test_no_alignment_require_zero_size_scratch() localVariable
1297 assert_eq!(required_scratch_size(&mut blk.io, 0).unwrap(), 0); in test_no_alignment_require_zero_size_scratch()
1305 let mut blk = TestBlockDeviceBuilder::new() in test_scratch_too_small() localVariable
1310 assert!(blk.read(0, &mut vec![0u8; block_size.try_into().unwrap()]).is_err()); in test_scratch_too_small()
1315 let mut blk = TestBlockDeviceBuilder::new() in test_read_overflow() localVariable
1321 assert!(blk.read(512, &mut vec![0u8; 1]).is_err()); in test_read_overflow()
1322 assert!(blk.read(0, &mut vec![0u8; 513]).is_err()); in test_read_overflow()
1327 let mut blk = TestBlockDeviceBuilder::new() in test_read_arithmetic_overflow() localVariable
1333 assert!(blk.read(u64::MAX, &mut vec![0u8; 1]).is_err()); in test_read_arithmetic_overflow()
1338 let mut blk = TestBlockDeviceBuilder::new() in test_write_overflow() localVariable
1344 assert!(blk.write(512, vec![0u8; 1].as_mut_slice()).is_err()); in test_write_overflow()
1345 assert!(blk.write(0, vec![0u8; 513].as_mut_slice()).is_err()); in test_write_overflow()
1350 let mut blk = TestBlockDeviceBuilder::new() in test_write_arithmetic_overflow() localVariable
1356 assert!(blk.write(u64::MAX, vec![0u8; 1].as_mut_slice()).is_err()); in test_write_arithmetic_overflow()