Skip to content

Commit

Permalink
fix windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythra committed Jan 14, 2025
1 parent d09b335 commit db1c4b8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 10 additions & 0 deletions pkg/cat-dev/src/fsemul/dlf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,16 @@ mod unit_tests {
0,
"Real-DLF didn't parse correct minor version!"
);
#[cfg(target_os = "windows")]
assert_eq!(
dlf.get_path_and_offset_for_file(0x80000_u128).await,
Some((
&PathBuf::from(r#"C:\cafe_sdk\temp\mythra\caferun\ppc.bsf"#),
0
)),
"Real-DLF did not match correct path for address.",
);
#[cfg(not(target_os = "windows"))]
assert_eq!(
dlf.get_path_and_offset_for_file(0x80000_u128).await,
Some((
Expand Down
10 changes: 6 additions & 4 deletions pkg/cat-dev/src/fsemul/pcfs/sata_proto/get_info_by_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,12 @@ impl SataGetInfoByQueryPacketBody {
//
// E.g. find the mountpoint that is _most specific_.
for potential_disk in &disks {
if fs_location
.closest_resolved_path()
.starts_with(potential_disk.mount_point())
{
let mount_point = potential_disk.mount_point();
if fs_location.closest_resolved_path().starts_with(
mount_point
.canonicalize()
.unwrap_or_else(|_| mount_point.to_path_buf()),
) {
let mut should_insert = true;
if let Some(other_potential_source) = disk_holding_path {
if other_potential_source.mount_point().components().count()
Expand Down

0 comments on commit db1c4b8

Please sign in to comment.