Skip to content

Commit

Permalink
fix: SDL testing
Browse files Browse the repository at this point in the history
Adds unwrap() to the run_image_test() calls.
  • Loading branch information
joamag committed Feb 23, 2024
1 parent 67a4578 commit 89c00a3
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions frontends/sdl/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ mod tests {
"../../res/roms/test/blargg/cpu/cpu_instrs.gb",
Some(300000000),
TestOptions::default(),
);
)
.unwrap();
let image_result = compare_images(&result, "res/test/blargg/cpu/cpu_instrs.png");
assert!(image_result);
}
Expand All @@ -63,7 +64,8 @@ mod tests {
"../../res/roms/test/blargg/instr_timing/instr_timing.gb",
Some(50000000),
TestOptions::default(),
);
)
.unwrap();
let image_result = compare_images(&result, "res/test/blargg/instr_timing/instr_timing.png");
assert!(image_result);
}
Expand All @@ -74,23 +76,26 @@ mod tests {
"../../res/roms/test/blargg/dmg_sound/01-registers.gb",
Some(50000000),
TestOptions::default(),
);
)
.unwrap();
let image_result = compare_images(&result, "res/test/blargg/dmg_sound/01-registers.png");
assert!(image_result);

let result: [u8; FRAME_BUFFER_SIZE] = run_image_test(
"../../res/roms/test/blargg/dmg_sound/02-len ctr.gb",
Some(50000000),
TestOptions::default(),
);
)
.unwrap();
let image_result = compare_images(&result, "res/test/blargg/dmg_sound/02-len ctr.png");
assert!(image_result);

let result: [u8; FRAME_BUFFER_SIZE] = run_image_test(
"../../res/roms/test/blargg/dmg_sound/03-trigger.gb",
Some(100000000),
TestOptions::default(),
);
)
.unwrap();
let image_result = compare_images(&result, "res/test/blargg/dmg_sound/03-trigger.png");
assert!(image_result);
}
Expand All @@ -101,7 +106,8 @@ mod tests {
"../../res/roms/test/dmg_acid2.gb",
Some(50000000),
TestOptions::default(),
);
)
.unwrap();
let image_result = compare_images(&result, "res/test/dmg_acid2.png");
assert!(image_result);
}
Expand All @@ -115,7 +121,8 @@ mod tests {
mode: Some(GameBoyMode::Cgb),
..Default::default()
},
);
)
.unwrap();
let image_result = compare_images(&result, "res/test/cgb_acid2.png");
assert!(image_result);
}
Expand All @@ -126,7 +133,8 @@ mod tests {
"../../res/roms/test/firstwhite.gb",
Some(50000000),
TestOptions::default(),
);
)
.unwrap();
let image_result = compare_images(&result, "res/test/firstwhite.png");
assert!(image_result);
}
Expand Down

0 comments on commit 89c00a3

Please sign in to comment.