diff --git a/modules/rostests/apitests/shell32/CMakeLists.txt b/modules/rostests/apitests/shell32/CMakeLists.txt index 53c87297d89..1e387327dc9 100644 --- a/modules/rostests/apitests/shell32/CMakeLists.txt +++ b/modules/rostests/apitests/shell32/CMakeLists.txt @@ -60,3 +60,4 @@ target_link_libraries(shell32_apitest_sub cpprt atl_classes) set_module_type(shell32_apitest_sub win32gui UNICODE) add_importlibs(shell32_apitest_sub msvcrt kernel32 user32 shell32 shlwapi ole32) add_rostests_file(TARGET shell32_apitest_sub SUBDIR testdata) +add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ROS.ico") diff --git a/modules/rostests/apitests/shell32/ExtractIconEx.cpp b/modules/rostests/apitests/shell32/ExtractIconEx.cpp index e32f3ac34d2..9a5f421502c 100644 --- a/modules/rostests/apitests/shell32/ExtractIconEx.cpp +++ b/modules/rostests/apitests/shell32/ExtractIconEx.cpp @@ -22,16 +22,33 @@ EXTRACTICONTESTS IconTests[] = {L"%SystemRoot%\\System32\\autochk.exe", 0}, /* Non-existing files */ - {L"%SystemRoot%\\non-existent-file.sdf", 0} + {L"%SystemRoot%\\non-existent-file.sdf", 0}, + + /* Multiple icons in the same ICO file (6 icons) */ + {L"%SystemRoot%\\bin\\sysicon.ico", 1}, + + /* Multiple icons in the same EXE file (18 icons) */ + {L"%SystemRoot%\\explorer.exe", 18}, + + /* One standard icon and one PNG in same file */ + {L"%SystemRoot%\\bin\\ROS.ico", 1} }; START_TEST(ExtractIconEx) { - UINT i, nReturnedIcons; + UINT i, nReturnedIcons, nExtractedIcons; + /* Check count of icons returned */ for (i = 0; i < _countof(IconTests); ++i) { - nReturnedIcons = ExtractIconExW(IconTests[i].pszFilePath, 0, NULL, NULL, IconTests[i].nIcons); + nReturnedIcons = ExtractIconExW(IconTests[i].pszFilePath, -1, NULL, NULL, 0); ok(nReturnedIcons == IconTests[i].nIcons, "ExtractIconExW(%u): Expected %u icons, got %u\n", i, IconTests[i].nIcons, nReturnedIcons); } + + /* Check if the 0th icon can be extracted successfully */ + for (i = 0; i < _countof(IconTests); ++i) + { + nExtractedIcons = ExtractIconExW(IconTests[i].pszFilePath, 0, NULL, NULL, 1); + ok(nExtractedIcons == IconTests[i].nIcons, "ExtractIconExW(%u): Expected %u icons, got %u\n", i, IconTests[i].nIcons, nExtractedIcons); + } } --- a/modules/rostests/win32/user32/sysicon/CMakeLists.txt +++ b/modules/rostests/win32/user32/sysicon/CMakeLists.txt @@ -8,3 +8,4 @@ target_link_libraries(sysicon ${PSEH_LIB}) set_module_type(sysicon win32gui UNICODE) add_importlibs(sysicon gdi32 user32 msvcrt kernel32) add_rostests_file(TARGET sysicon SUBDIR suppl) +add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/sysicon.ico")