2
0

title_dlls.rs 622 B

12345678910111213141516
  1. //! A title DLL that cannot be loaded is named in the error.
  2. #![cfg(windows)]
  3. #[test]
  4. fn a_title_dll_that_does_not_prepare_is_named() {
  5. let title = tempfile::tempdir().unwrap();
  6. let cache = tempfile::tempdir().unwrap();
  7. std::fs::write(title.path().join("broken.dll"), b"MZ not a PE").unwrap();
  8. let wanted = |_: &str| true;
  9. let loaded = victory_loader::load_title_dll("broken.dll", title.path(), cache.path(), &wanted);
  10. let Err(error) = loaded else {
  11. panic!("a DLL that is not a PE loaded");
  12. };
  13. let text = format!("{error:#}");
  14. assert!(text.contains("broken.dll"), "{text}");
  15. }