-- v6: 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 | 59 ++++++++++++++++++++++++++++++ 4 files changed, 66 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..6ace9d1cf02 --- /dev/null +++ b/dlls/bcp47langs/tests/bcp47langs.c @@ -0,0 +1,59 @@ +/* + * 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)(char, HSTRING *); + +static void test_getuserlanguages(void) +{ + DWORD hr; + HSTRING usrlangs; + + if (!pGetUserLanguages) + { + win_skip("GetUserLanguages is not available, skipping tests.\n"); + return; + } + + hr = pGetUserLanguages('|', NULL); + todo_wine ok(hr == 0, "got %ld.\n", hr); + + hr = pGetUserLanguages('|', &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=150051
Your paranoid android.
=== w8 (32 bit report) ===
bcp47langs: 0bb8:bcp47langs: unhandled exception c0000005 at 72E7CDF7
=== w8adm (32 bit report) ===
bcp47langs: 0a80:bcp47langs: unhandled exception c0000005 at 72F8CDF7
=== w864 (32 bit report) ===
bcp47langs: 02d0:bcp47langs: unhandled exception c0000005 at 72B7CDF7
=== w1064v1507 (32 bit report) ===
bcp47langs: 0638:bcp47langs: unhandled exception c0000005 at 74941E5A
=== w1064v1809 (32 bit report) ===
bcp47langs: 1ddc:bcp47langs: unhandled exception c0000005 at 74AD4C6E
=== w1064_tsign (32 bit report) ===
bcp47langs: 1dc8:bcp47langs: unhandled exception c0000005 at 754C5E91
=== w10pro64 (32 bit report) ===
bcp47langs: 20ac:bcp47langs: unhandled exception c0000005 at 73E25E91
=== w10pro64_en_AE_u8 (32 bit report) ===
bcp47langs: 2368:bcp47langs: unhandled exception c0000005 at 74955E91
=== w11pro64 (32 bit report) ===
bcp47langs: 14ac:bcp47langs: unhandled exception c0000005 at 74095111
=== w864 (64 bit report) ===
bcp47langs: 0ae0:bcp47langs: unhandled exception c0000005 at 00007FFA453754D7
=== w1064v1507 (64 bit report) ===
bcp47langs: 0480:bcp47langs: unhandled exception c0000005 at 00007FFAD8B268DE
=== w1064v1809 (64 bit report) ===
bcp47langs: 1da4:bcp47langs: unhandled exception c0000005 at 00007FFFB51C0C15
=== w1064_2qxl (64 bit report) ===
bcp47langs: 1e14:bcp47langs: unhandled exception c0000005 at 00007FFFEF0E15E5
=== w1064_adm (64 bit report) ===
bcp47langs: 130c:bcp47langs: unhandled exception c0000005 at 00007FFA480D15E5
=== w1064_tsign (64 bit report) ===
bcp47langs: 1ea4:bcp47langs: unhandled exception c0000005 at 00007FFA97A015E5
=== w10pro64 (64 bit report) ===
bcp47langs: 20e0:bcp47langs: unhandled exception c0000005 at 00007FFF21B215E5
=== w10pro64_ar (64 bit report) ===
bcp47langs: 2094:bcp47langs: unhandled exception c0000005 at 00007FF9FBAE15E5
=== w10pro64_ja (64 bit report) ===
bcp47langs: 0ed8:bcp47langs: unhandled exception c0000005 at 00007FF9635A15E5
=== w10pro64_zh_CN (64 bit report) ===
bcp47langs: 1ea4:bcp47langs: unhandled exception c0000005 at 00007FF8A9AA15E5
=== w11pro64_amd (64 bit report) ===
bcp47langs: 0ea0:bcp47langs: unhandled exception c0000005 at 00007FFA578DF85C
=== 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) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000007000E6, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
Report validation errors: bcp47langs:bcp47langs crashed (80000100)