[PATCH 1/3] windows.globalization/tests: pRoActivateInstance() is unused. Remove it.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> --- dlls/windows.globalization/tests/globalization.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dlls/windows.globalization/tests/globalization.c b/dlls/windows.globalization/tests/globalization.c index b824cfdf8ae..aa51b8b83f9 100644 --- a/dlls/windows.globalization/tests/globalization.c +++ b/dlls/windows.globalization/tests/globalization.c @@ -34,7 +34,6 @@ #include "wine/test.h" -static HRESULT (WINAPI *pRoActivateInstance)(HSTRING, IInspectable **); static HRESULT (WINAPI *pRoGetActivationFactory)(HSTRING, REFIID, void **); static HRESULT (WINAPI *pRoInitialize)(RO_INIT_TYPE); static void (WINAPI *pRoUninitialize)(void); @@ -240,7 +239,6 @@ START_TEST(globalization) return; \ } - LOAD_FUNCPTR(RoActivateInstance); LOAD_FUNCPTR(RoGetActivationFactory); LOAD_FUNCPTR(RoInitialize); LOAD_FUNCPTR(RoUninitialize); -- 2.20.1
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> --- Unfortunately we don't have a non-English test configuration for Windows 10 1709. It would be interesting to see if it return "" too. --- dlls/windows.globalization/tests/globalization.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/windows.globalization/tests/globalization.c b/dlls/windows.globalization/tests/globalization.c index 7746e93dc1a..631c7ad2449 100644 --- a/dlls/windows.globalization/tests/globalization.c +++ b/dlls/windows.globalization/tests/globalization.c @@ -108,8 +108,10 @@ static void test_GlobalizationPreferences(void) if (pGetUserDefaultGeoName) { WCHAR country[16]; - pGetUserDefaultGeoName(country, ARRAY_SIZE(country)); - ok(wcslen(country) == len && !memcmp(buf, country, len), + DWORD geolen; + geolen = pGetUserDefaultGeoName(country, ARRAY_SIZE(country)); + ok(broken(geolen == 1) || /* Win10 1709 */ + (wcslen(country) == len && !memcmp(buf, country, len)), "IGlobalizationPreferencesStatics_get_HomeGeographicRegion returned len %u, str %s, expected %s\n", len, wine_dbgstr_w(buf), wine_dbgstr_w(country)); } -- 2.20.1
Many windows versions before Windows 10 1709 have windows.globalization.dll but not GetUserDefaultGeoName(). Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> --- This leaves the Windows 10 1709 failure for the next patch. --- .../tests/globalization.c | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/dlls/windows.globalization/tests/globalization.c b/dlls/windows.globalization/tests/globalization.c index aa51b8b83f9..7746e93dc1a 100644 --- a/dlls/windows.globalization/tests/globalization.c +++ b/dlls/windows.globalization/tests/globalization.c @@ -34,6 +34,11 @@ #include "wine/test.h" + +/* kernel32.dll */ +static INT (WINAPI *pGetUserDefaultGeoName)(LPWSTR, int); + +/* combase.dll */ static HRESULT (WINAPI *pRoGetActivationFactory)(HSTRING, REFIID, void **); static HRESULT (WINAPI *pRoInitialize)(RO_INIT_TYPE); static void (WINAPI *pRoUninitialize)(void); @@ -41,6 +46,7 @@ static HRESULT (WINAPI *pWindowsCreateString)(LPCWSTR, UINT32, HSTRING *); static HRESULT (WINAPI *pWindowsDeleteString)(HSTRING); static WCHAR *(WINAPI *pWindowsGetStringRawBuffer)(HSTRING, UINT32 *); + static void test_GlobalizationPreferences(void) { static const WCHAR *class_name = L"Windows.System.UserProfile.GlobalizationPreferences"; @@ -54,11 +60,10 @@ static void test_GlobalizationPreferences(void) BOOLEAN found; HRESULT hr; UINT32 len; - WCHAR *buf, locale[LOCALE_NAME_MAX_LENGTH], country[16]; + WCHAR *buf, locale[LOCALE_NAME_MAX_LENGTH]; UINT32 i, size; GetUserDefaultLocaleName(locale, LOCALE_NAME_MAX_LENGTH); - GetUserDefaultGeoName(country, 16); hr = pRoInitialize(RO_INIT_MULTITHREADED); ok(hr == S_OK, "RoInitialize failed, hr %#x\n", hr); @@ -100,9 +105,14 @@ static void test_GlobalizationPreferences(void) buf = pWindowsGetStringRawBuffer(tmp_str, &len); ok(buf != NULL && len > 0, "WindowsGetStringRawBuffer returned buf %p, len %u\n", buf, len); - ok(wcslen(country) == len && !memcmp(buf, country, len), - "IGlobalizationPreferencesStatics_get_HomeGeographicRegion returned len %u, str %s, expected %s\n", - len, wine_dbgstr_w(buf), wine_dbgstr_w(country)); + if (pGetUserDefaultGeoName) + { + WCHAR country[16]; + pGetUserDefaultGeoName(country, ARRAY_SIZE(country)); + ok(wcslen(country) == len && !memcmp(buf, country, len), + "IGlobalizationPreferencesStatics_get_HomeGeographicRegion returned len %u, str %s, expected %s\n", + len, wine_dbgstr_w(buf), wine_dbgstr_w(country)); + } pWindowsDeleteString(tmp_str); @@ -224,7 +234,7 @@ static void test_GlobalizationPreferences(void) START_TEST(globalization) { - HMODULE combase; + HMODULE combase, kernel32; if (!(combase = LoadLibraryW(L"combase.dll"))) { @@ -247,5 +257,8 @@ START_TEST(globalization) LOAD_FUNCPTR(WindowsGetStringRawBuffer); #undef LOAD_FUNCPTR + kernel32 = GetModuleHandleA("kernel32"); + pGetUserDefaultGeoName = (void*)GetProcAddress(kernel32, "GetUserDefaultGeoName"); + test_GlobalizationPreferences(); } -- 2.20.1
participants (1)
-
Francois Gouget