Skip to content

Commit

Permalink
fix ppc_boot test for dlf on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythra committed Jan 14, 2025
1 parent b7c832a commit d09b335
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
21 changes: 17 additions & 4 deletions pkg/cat-dev/src/fsemul/dlf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,23 @@ mod unit_tests {
#[tokio::test]
pub async fn can_parse_real_files() {
// Just validate these don't error.
let real_life_dlf = Bytes::from(
std::fs::read(get_test_data_path("ppc_boot.dlf"))
.expect("Failed to read `ppc_boot.dlf` test data file!"),
);
let real_life_dlf;

#[cfg(target_os = "windows")]
{
real_life_dlf = Bytes::from(
std::fs::read(get_test_data_path("ppc_boot_win.dlf"))
.expect("Failed to read `ppc_boot.dlf` test data file!"),
);
}
#[cfg(not(target_os = "windows"))]
{
real_life_dlf = Bytes::from(
std::fs::read(get_test_data_path("ppc_boot.dlf"))
.expect("Failed to read `ppc_boot.dlf` test data file!"),
);
}

let empty_dlf = Bytes::from(
std::fs::read(get_test_data_path("minimal.dlf"))
.expect("Failed to read `minimal.dlf` test data file!"),
Expand Down
5 changes: 5 additions & 0 deletions pkg/cat-dev/src/fsemul/test-data/ppc_boot_win.dlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
v1.00
0x0000000000000000,"C:\cafe_sdk\temp\mythra\caferun\diskid.bin"
0x0000000000080000,"C:\cafe_sdk\temp\mythra\caferun\ppc.bsf"
0x0000000000090000,"C:\cafe_sdk\data\slc\sys\title\00050010\1000400a\code\fw.img"
0x0000000000B88200,""

0 comments on commit d09b335

Please sign in to comment.