Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Print: let the Windows PDF test pass where the system DLL cannot load (#5884)

Higgs32584732070b22d77
diff --git a/crates/engine/src/print_cmds/tests.rs b/crates/engine/src/print_cmds/tests.rs
index 2b0f71bc1..31dfa5d1a 100644
--- a/crates/engine/src/print_cmds/tests.rs
+++ b/crates/engine/src/print_cmds/tests.rs
@@ -786,11 +786,9 @@ fn windows_pdf_component_is_detected_by_loading_its_dll() {
std::fs::write(&dll, b"MZ").unwrap();
assert!(!windows_pdf_loads(&dll));
let root = std::env::var_os("SystemRoot").unwrap();
+ // The real DLL may be missing or unloadable on a stripped image; the check follows the loader.
let system = windows_pdf_dll(std::path::Path::new(&root));
- if system.is_file() {
- assert!(windows_pdf_loads(&system));
- assert!(require_windows_pdf().is_ok());
- }
+ assert_eq!(require_windows_pdf().is_ok(), windows_pdf_loads(&system));
}
#[cfg(not(target_os = "windows"))]