-- v10: bcp47langs: Add tests for GetUserLanguages.
From: Vijay Kiran Kamuju infyquest@gmail.com
--- configure | 1 + configure.ac | 1 + dlls/bcp47langs/tests/Makefile.in | 5 +++ dlls/bcp47langs/tests/bcp47langs.c | 60 ++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 dlls/bcp47langs/tests/Makefile.in create mode 100644 dlls/bcp47langs/tests/bcp47langs.c
diff --git a/configure b/configure index d054480f666..ace1d505b83 100755 --- a/configure +++ b/configure @@ -22027,6 +22027,7 @@ wine_fn_config_makefile dlls/avifil32/tests enable_tests wine_fn_config_makefile dlls/avifile.dll16 enable_win16 wine_fn_config_makefile dlls/avrt enable_avrt wine_fn_config_makefile dlls/bcp47langs enable_bcp47langs +wine_fn_config_makefile dlls/bcp47langs/tests enable_tests wine_fn_config_makefile dlls/bcrypt enable_bcrypt wine_fn_config_makefile dlls/bcrypt/tests enable_tests wine_fn_config_makefile dlls/bcryptprimitives enable_bcryptprimitives diff --git a/configure.ac b/configure.ac index de80d65b240..ab2adf02666 100644 --- a/configure.ac +++ b/configure.ac @@ -2423,6 +2423,7 @@ WINE_CONFIG_MAKEFILE(dlls/avifil32/tests) WINE_CONFIG_MAKEFILE(dlls/avifile.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/avrt) WINE_CONFIG_MAKEFILE(dlls/bcp47langs) +WINE_CONFIG_MAKEFILE(dlls/bcp47langs/tests) WINE_CONFIG_MAKEFILE(dlls/bcrypt) WINE_CONFIG_MAKEFILE(dlls/bcrypt/tests) WINE_CONFIG_MAKEFILE(dlls/bcryptprimitives) diff --git a/dlls/bcp47langs/tests/Makefile.in b/dlls/bcp47langs/tests/Makefile.in new file mode 100644 index 00000000000..473ff79c712 --- /dev/null +++ b/dlls/bcp47langs/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = bcp47langs.dll +IMPORTS = combase + +SOURCES = \ + bcp47langs.c diff --git a/dlls/bcp47langs/tests/bcp47langs.c b/dlls/bcp47langs/tests/bcp47langs.c new file mode 100644 index 00000000000..41dfbbbca09 --- /dev/null +++ b/dlls/bcp47langs/tests/bcp47langs.c @@ -0,0 +1,60 @@ +/* + * Unit tests for BCP47 Language functions + * + * Copyright (c) 2024 Vijay Kiran Kamuju + * + * 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 <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "winstring.h" + +#include "wine/test.h" + +static DWORD (WINAPI *pGetUserLanguages)(WCHAR, HSTRING *); + +static void test_getuserlanguages(void) +{ + DWORD hr; + HSTRING usrlangs; + + if (!pGetUserLanguages) + { + win_skip("GetUserLanguages is not available, skipping tests.\n"); + return; + } + + hr = pGetUserLanguages('|', &usrlangs); + todo_wine ok(hr == 0, "got %ld.\n", hr); + WindowsDeleteString(usrlangs); + + hr = pGetUserLanguages(L',', &usrlangs); + todo_wine ok(hr == 0, "got %ld.\n", hr); + WindowsDeleteString(usrlangs); +} + +START_TEST(bcp47langs) +{ + HMODULE hmod; + + hmod = LoadLibraryA("bcp47langs.dll"); + pGetUserLanguages = (void *)GetProcAddress(hmod, "GetUserLanguages"); + + test_getuserlanguages(); +}
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=150078
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors: bcp47langs:bcp47langs crashed (80000100)
=== debian11 (32 bit ar:MA report) ===
Report validation errors: bcp47langs:bcp47langs crashed (80000100)
=== debian11 (32 bit de report) ===
Report validation errors: bcp47langs:bcp47langs crashed (80000100)
=== debian11 (32 bit fr report) ===
Report validation errors: bcp47langs:bcp47langs crashed (80000100)
=== debian11 (32 bit he:IL report) ===
Report validation errors: bcp47langs:bcp47langs crashed (80000100)
=== debian11 (32 bit hi:IN report) ===
Report validation errors: bcp47langs:bcp47langs crashed (80000100)
=== debian11 (32 bit ja:JP report) ===
Report validation errors: bcp47langs:bcp47langs crashed (80000100)
=== debian11 (32 bit zh:CN report) ===
Report validation errors: bcp47langs:bcp47langs crashed (80000100)
=== debian11b (32 bit WoW report) ===
Report validation errors: bcp47langs:bcp47langs crashed (80000100)
=== debian11b (64 bit WoW report) ===
dinput: joystick8.c:5762: Test failed: input 1: WaitForSingleObject returned 0x102 joystick8.c:5763: Test failed: input 1: got 0 WM_INPUT messages joystick8.c:5766: Test failed: input 1: got dwType 0 joystick8.c:5767: Test failed: input 1: got header.dwSize 0 joystick8.c:5769: Test failed: input 1: got hDevice 0000000000000000 joystick8.c:5771: Test failed: input 1: got dwSizeHid 0 joystick8.c:5772: Test failed: input 1: got dwCount 0
Report validation errors: bcp47langs:bcp47langs crashed (80000100)