test: add test for default icon resource

This commit is contained in:
yyc12345 committed 2026-05-27 19:12:52 +08:00
1 parent 8c61aa1e1d
commit 0533cdab23
2 files changed
+8 -10

No files matched your search

+6
View File
@@ -186,6 +186,9 @@ fn test_str_ref_str() {
#[test]
fn test_icon_rc() {
fn const_tester(icon: Result<IconRc, LoadIconRcError>) {
assert!(icon.is_ok())
}
fn ok_tester(file: &str, index: u32) {
let icon = IconRc::new(file, index, IconSizeKind::Small);
assert!(icon.is_ok())
@@ -195,6 +198,9 @@ fn test_icon_rc() {
assert!(icon.is_err())
}
// Test 2 const value
const_tester(IconRc::GENERIC_APPLICATION(IconSizeKind::Small));
const_tester(IconRc::GENERIC_APPLICATION(IconSizeKind::Small));
// We pick it from "jpegfile" ProgId
ok_tester("imageres.dll", 72);
ok_tester("notepad.exe", 0);