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 fb4163f70d4..27425088e9e 100755 --- a/configure +++ b/configure @@ -22024,6 +22024,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 ac710721ae6..380bb271c39 100644 --- a/configure.ac +++ b/configure.ac @@ -2422,6 +2422,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(); +}