Commit 309c1014 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

windows.globalization/tests: Enable compilation with long types.

parent 1aebae92
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = windows.globalization.dll
IMPORTS = combase uuid
......
......@@ -59,13 +59,13 @@ static void test_GlobalizationPreferences(void)
GetUserDefaultLocaleName(locale, LOCALE_NAME_MAX_LENGTH);
hr = RoInitialize(RO_INIT_MULTITHREADED);
ok(hr == S_OK, "RoInitialize failed, hr %#x\n", hr);
ok(hr == S_OK, "RoInitialize failed, hr %#lx\n", hr);
hr = WindowsCreateString(class_name, wcslen(class_name), &str);
ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#x\n", hr);
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#lx\n", hr);
if (hr == REGDB_E_CLASSNOTREG)
{
win_skip("%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w(class_name));
......@@ -75,26 +75,26 @@ static void test_GlobalizationPreferences(void)
}
hr = IActivationFactory_QueryInterface(factory, &IID_IInspectable, (void **)&inspectable);
ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IAgileObject, (void **)&agile_object);
ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IGlobalizationPreferencesStatics, (void **)&preferences_statics);
ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IGlobalizationPreferencesStatics failed, hr %#x\n", hr);
ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IGlobalizationPreferencesStatics failed, hr %#lx\n", hr);
hr = IGlobalizationPreferencesStatics_QueryInterface(preferences_statics, &IID_IInspectable, (void **)&tmp_inspectable);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
ok(tmp_inspectable == inspectable, "IGlobalizationPreferencesStatics_QueryInterface IID_IInspectable returned %p, expected %p\n", tmp_inspectable, inspectable);
IInspectable_Release(tmp_inspectable);
hr = IGlobalizationPreferencesStatics_QueryInterface(preferences_statics, &IID_IAgileObject, (void **)&tmp_agile_object);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
ok(tmp_agile_object == agile_object, "IGlobalizationPreferencesStatics_QueryInterface IID_IAgileObject returned %p, expected %p\n", tmp_agile_object, agile_object);
IAgileObject_Release(tmp_agile_object);
hr = IGlobalizationPreferencesStatics_get_HomeGeographicRegion(preferences_statics, &tmp_str);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_HomeGeographicRegion failed, hr %#x\n", hr);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_HomeGeographicRegion failed, hr %#lx\n", hr);
buf = WindowsGetStringRawBuffer(tmp_str, &len);
ok(buf != NULL && len > 0, "WindowsGetStringRawBuffer returned buf %p, len %u\n", buf, len);
......@@ -112,25 +112,25 @@ static void test_GlobalizationPreferences(void)
WindowsDeleteString(tmp_str);
hr = IGlobalizationPreferencesStatics_get_Languages(preferences_statics, &languages);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Languages failed, hr %#x\n", hr);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Languages failed, hr %#lx\n", hr);
hr = IVectorView_HSTRING_QueryInterface(languages, &IID_IInspectable, (void **)&tmp_inspectable);
ok(hr == S_OK, "IVectorView_HSTRING_QueryInterface failed, hr %#x\n", hr);
ok(hr == S_OK, "IVectorView_HSTRING_QueryInterface failed, hr %#lx\n", hr);
ok(tmp_inspectable != inspectable, "IVectorView_HSTRING_QueryInterface returned %p, expected %p\n", tmp_inspectable, inspectable);
IInspectable_Release(tmp_inspectable);
hr = IVectorView_HSTRING_QueryInterface(languages, &IID_IAgileObject, (void **)&tmp_agile_object);
ok(hr == S_OK, "IVectorView_HSTRING_QueryInterface failed, hr %#x\n", hr);
ok(hr == S_OK, "IVectorView_HSTRING_QueryInterface failed, hr %#lx\n", hr);
ok(tmp_agile_object != agile_object, "IVectorView_HSTRING_QueryInterface IID_IAgileObject returned agile_object\n");
IAgileObject_Release(tmp_agile_object);
size = 0xdeadbeef;
hr = IVectorView_HSTRING_get_Size(languages, &size);
ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#x\n", hr);
ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#lx\n", hr);
ok(size != 0 && size != 0xdeadbeef, "IVectorView_HSTRING_get_Size returned %u\n", size);
hr = IVectorView_HSTRING_GetAt(languages, 0, &tmp_str);
ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#x\n", hr);
ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#lx\n", hr);
buf = WindowsGetStringRawBuffer(tmp_str, &len);
ok(buf != NULL && len > 0, "WindowsGetStringRawBuffer returned buf %p, len %u\n", buf, len);
......@@ -141,34 +141,34 @@ static void test_GlobalizationPreferences(void)
i = 0xdeadbeef;
found = FALSE;
hr = IVectorView_HSTRING_IndexOf(languages, tmp_str, &i, &found);
ok(hr == S_OK, "IVectorView_HSTRING_IndexOf failed, hr %#x\n", hr);
ok(hr == S_OK, "IVectorView_HSTRING_IndexOf failed, hr %#lx\n", hr);
ok(i == 0 && found == TRUE, "IVectorView_HSTRING_IndexOf returned size %d, found %d\n", size, found);
WindowsDeleteString(tmp_str);
hr = WindowsCreateString(L"deadbeef", 8, &tmp_str);
ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
i = 0xdeadbeef;
found = TRUE;
hr = IVectorView_HSTRING_IndexOf(languages, tmp_str, &i, &found);
ok(hr == S_OK, "IVectorView_HSTRING_IndexOf failed, hr %#x\n", hr);
ok(hr == S_OK, "IVectorView_HSTRING_IndexOf failed, hr %#lx\n", hr);
ok(i == 0 && found == FALSE, "IVectorView_HSTRING_IndexOf returned size %d, found %d\n", size, found);
WindowsDeleteString(tmp_str);
tmp_str = (HSTRING)0xdeadbeef;
hr = IVectorView_HSTRING_GetAt(languages, size, &tmp_str);
ok(hr == E_BOUNDS, "IVectorView_HSTRING_GetAt failed, hr %#x\n", hr);
ok(hr == E_BOUNDS, "IVectorView_HSTRING_GetAt failed, hr %#lx\n", hr);
ok(tmp_str == NULL, "IVectorView_HSTRING_GetAt returned %p\n", tmp_str);
tmp_str = (HSTRING)0xdeadbeef;
hr = IVectorView_HSTRING_GetMany(languages, size, 1, &tmp_str, &i);
ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#x\n", hr);
ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#lx\n", hr);
ok(i == 0 && tmp_str == NULL, "IVectorView_HSTRING_GetMany returned count %u, str %p\n", i, tmp_str);
hr = IVectorView_HSTRING_GetMany(languages, 0, 1, &tmp_str, &i);
ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#x\n", hr);
ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#lx\n", hr);
ok(i == 1, "IVectorView_HSTRING_GetMany returned count %u, expected 1\n", i);
buf = WindowsGetStringRawBuffer(tmp_str, &len);
......@@ -184,33 +184,33 @@ static void test_GlobalizationPreferences(void)
hr = IGlobalizationPreferencesStatics_get_Calendars(preferences_statics, &calendars);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Calendars failed, hr %#x\n", hr);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Calendars failed, hr %#lx\n", hr);
size = 0xdeadbeef;
hr = IVectorView_HSTRING_get_Size(calendars, &size);
ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#x\n", hr);
ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#lx\n", hr);
todo_wine ok(size != 0 && size != 0xdeadbeef, "IVectorView_HSTRING_get_Size returned %u\n", size);
IVectorView_HSTRING_Release(calendars);
hr = IGlobalizationPreferencesStatics_get_Clocks(preferences_statics, &clocks);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Clocks failed, hr %#x\n", hr);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Clocks failed, hr %#lx\n", hr);
size = 0xdeadbeef;
hr = IVectorView_HSTRING_get_Size(clocks, &size);
ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#x\n", hr);
ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#lx\n", hr);
todo_wine ok(size != 0 && size != 0xdeadbeef, "IVectorView_HSTRING_get_Size returned %u\n", size);
IVectorView_HSTRING_Release(clocks);
hr = IGlobalizationPreferencesStatics_get_Currencies(preferences_statics, &currencies);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Currencies failed, hr %#x\n", hr);
ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Currencies failed, hr %#lx\n", hr);
size = 0xdeadbeef;
hr = IVectorView_HSTRING_get_Size(currencies, &size);
ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#x\n", hr);
ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#lx\n", hr);
todo_wine ok(size != 0 && size != 0xdeadbeef, "IVectorView_HSTRING_get_Size returned %u\n", size);
IVectorView_HSTRING_Release(currencies);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment