shell32: Run the conformance tests for the PickIconDlg function.
The conformance test verifies that PickIconDlg behaves in the same way as the original function when illegal parameter values are used.
From: Matthias Zorn matthias0178@gmail.com
--- dlls/shell32/tests/Makefile.in | 3 +- dlls/shell32/tests/dialogs.c | 53 ++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 dlls/shell32/tests/dialogs.c
diff --git a/dlls/shell32/tests/Makefile.in b/dlls/shell32/tests/Makefile.in index b7bc53524a2..20651b78d79 100644 --- a/dlls/shell32/tests/Makefile.in +++ b/dlls/shell32/tests/Makefile.in @@ -21,4 +21,5 @@ SOURCES = \ shlfolder.c \ shlview.c \ string.c \ - systray.c + systray.c \ + dialogs.c diff --git a/dlls/shell32/tests/dialogs.c b/dlls/shell32/tests/dialogs.c new file mode 100644 index 00000000000..b9851b0708d --- /dev/null +++ b/dlls/shell32/tests/dialogs.c @@ -0,0 +1,53 @@ +/* + * Unit tests for shell32 dialogs + * + * Copyright 2025 Matthias Zorn + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wine/test.h" +#include "winbase.h" +#include "shlobj.h" + +static void test_PickIconDlg(void) +{ + WCHAR icon_path_filename[30]; + int icon_index = 1; + int return_value; + + lstrcpyW(icon_path_filename, L"shell32.dll"); + SetLastError(0); + + todo_wine { + return_value = PickIconDlg(NULL, icon_path_filename, ARRAYSIZE(icon_path_filename), NULL); + ok(return_value == 0, "PickIconDlg(NULL, ..., NULL) return_value failed\n"); + } + + todo_wine { + return_value = PickIconDlg(NULL, NULL, ARRAYSIZE(icon_path_filename), &icon_index); + ok(return_value == 0, "PickIconDlg(NULL, NULL, ...) return_value failed\n"); + } + + todo_wine { + return_value = PickIconDlg((HWND) -1, icon_path_filename, ARRAYSIZE(icon_path_filename), &icon_index); + ok(return_value == 1, "PickIconDlg((HWND) -1, ...) return_value failed\n"); + } +} + +START_TEST(dialogs) +{ + test_PickIconDlg(); +}
This merge request was closed by Matthias Zorn.