-- v2: 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 | 62 ++++++++++++++++++++++++++++++ 4 files changed, 69 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..c9496b0f94a --- /dev/null +++ b/dlls/bcp47langs/tests/bcp47langs.c @@ -0,0 +1,62 @@ +/* + * 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('|', 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(string) +{ + 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 full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=150047
Your paranoid android.
=== build (build log) ===
../wine/dlls/bcp47langs/tests/bcp47langs.c:43:28: error: empty character constant Task: The exe32 Wine build failed
=== debian11 (build log) ===
../wine/dlls/bcp47langs/tests/bcp47langs.c:43:28: error: empty character constant Task: The win32 Wine build failed
=== debian11b (build log) ===
../wine/dlls/bcp47langs/tests/bcp47langs.c:43:28: error: empty character constant Task: The wow64 Wine build failed