e32f3ac34d2f8ecd5766f1939605c8f1f77429c9
[reactos.git] / modules / rostests / apitests / shell32 / ExtractIconEx.cpp
1 /*
2 * PROJECT: ReactOS API Tests
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Tests for ExtractIconEx routine
5 * COPYRIGHT: Copyright 2019 George Bișoc (george.bisoc@reactos.org)
6 */
7
8 #include "shelltest.h"
9
10 typedef struct
11 {
12 PCWSTR pszFilePath;
13 UINT nIcons;
14 } EXTRACTICONTESTS;
15
16 EXTRACTICONTESTS IconTests[] =
17 {
18 /* Executable file with icon */
19 {L"%SystemRoot%\\System32\\cmd.exe", 1},
20
21 /* Executable file without icon */
22 {L"%SystemRoot%\\System32\\autochk.exe", 0},
23
24 /* Non-existing files */
25 {L"%SystemRoot%\\non-existent-file.sdf", 0}
26 };
27
28 START_TEST(ExtractIconEx)
29 {
30 UINT i, nReturnedIcons;
31
32 for (i = 0; i < _countof(IconTests); ++i)
33 {
34 nReturnedIcons = ExtractIconExW(IconTests[i].pszFilePath, 0, NULL, NULL, IconTests[i].nIcons);
35 ok(nReturnedIcons == IconTests[i].nIcons, "ExtractIconExW(%u): Expected %u icons, got %u\n", i, IconTests[i].nIcons, nReturnedIcons);
36 }
37 }