Skip to content

Commit 0a08961

Browse files
Increase test disk size to 10MiB
This space will be used to test copying of large files.
1 parent 10978ae commit 0a08961

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

uefi-test-runner/src/proto/media.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn test_existing_file(directory: &mut Directory) {
127127
let mut info_buffer = vec![0; 128];
128128
let info = file.get_info::<FileInfo>(&mut info_buffer).unwrap();
129129
assert_eq!(info.file_size(), 15);
130-
assert_eq!(info.physical_size(), 512);
130+
assert_eq!(info.physical_size(), 1024);
131131
let tp = TimeParams {
132132
year: 2000,
133133
month: 1,
@@ -355,7 +355,7 @@ fn test_partition_info(bt: &BootServices, disk_handle: Handle) {
355355

356356
assert_eq!(mbr.boot_indicator, 0);
357357
assert_eq!({ mbr.starting_lba }, 1);
358-
assert_eq!({ mbr.size_in_lba }, 1233);
358+
assert_eq!({ mbr.size_in_lba }, 20479);
359359
assert_eq!({ mbr.starting_chs }, [0, 0, 0]);
360360
assert_eq!(mbr.ending_chs, [0, 0, 0]);
361361
assert_eq!(mbr.os_type, MbrOsType(6));
@@ -412,9 +412,9 @@ pub fn test(bt: &BootServices) {
412412
.unwrap();
413413

414414
assert!(!fs_info.read_only());
415-
assert_eq!(fs_info.volume_size(), 512 * 1192);
416-
assert_eq!(fs_info.free_space(), 512 * 1190);
417-
assert_eq!(fs_info.block_size(), 512);
415+
assert_eq!(fs_info.volume_size(), 1024 * 10183);
416+
assert_eq!(fs_info.free_space(), 1024 * 10181);
417+
assert_eq!(fs_info.block_size(), 1024);
418418
assert_eq!(fs_info.volume_label().to_string(), "MbrTestDisk");
419419

420420
// Check that `get_boxed_info` returns the same info.

xtask/src/disk.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ fn get_partition_byte_range(mbr: &MBR) -> Range<usize> {
1414
}
1515

1616
pub fn create_mbr_test_disk(path: &Path) -> Result<()> {
17-
let num_sectors = 1234;
17+
// 10 MiB.
18+
let size_in_bytes = 10 * 1024 * 1024;
1819

1920
let partition_byte_range;
20-
let mut disk = vec![0; num_sectors * SECTOR_SIZE];
21+
let mut disk = vec![0; size_in_bytes];
2122
{
2223
let mut cur = std::io::Cursor::new(&mut disk);
2324

@@ -104,8 +105,8 @@ fn init_fat_test_partition(disk: &mut [u8], partition_byte_range: Range<usize>)
104105
let stats = fs.stats()?;
105106
// Assert these specific numbers here since they are checked by the
106107
// test-runner too.
107-
assert_eq!(stats.total_clusters(), 1192);
108-
assert_eq!(stats.free_clusters(), 1190);
108+
assert_eq!(stats.total_clusters(), 10183);
109+
assert_eq!(stats.free_clusters(), 10181);
109110

110111
Ok(())
111112
}

0 commit comments

Comments
 (0)