oleaut32/tests: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
91475415b7
commit
497cb25e5b
|
@ -1,4 +1,3 @@
|
|||
EXTRADEFS = -DWINE_NO_LONG_TYPES
|
||||
TESTDLL = oleaut32.dll
|
||||
IMPORTS = oleaut32 ole32 rpcrt4 user32 gdi32 advapi32
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ static void test_DispGetParam(void)
|
|||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 0, VT_I2, &result, &err_index);
|
||||
ok(hr == DISP_E_PARAMNOTFOUND,
|
||||
"Expected DISP_E_PARAMNOTFOUND, got %08x\n", hr);
|
||||
"Expected DISP_E_PARAMNOTFOUND, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_EMPTY,
|
||||
"Expected VT_EMPTY, got %08x\n", V_VT(&result));
|
||||
ok(err_index == 0xdeadbeef,
|
||||
|
@ -96,7 +96,7 @@ static void test_DispGetParam(void)
|
|||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 1, VT_I2, &result, &err_index);
|
||||
ok(hr == DISP_E_PARAMNOTFOUND,
|
||||
"Expected DISP_E_PARAMNOTFOUND, got %08x\n", hr);
|
||||
"Expected DISP_E_PARAMNOTFOUND, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_EMPTY,
|
||||
"Expected VT_EMPTY, got %08x\n", V_VT(&result));
|
||||
ok(err_index == 0xdeadbeef,
|
||||
|
@ -107,7 +107,7 @@ static void test_DispGetParam(void)
|
|||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 0, VT_I2, NULL, &err_index);
|
||||
ok(hr == DISP_E_PARAMNOTFOUND,
|
||||
"Expected DISP_E_PARAMNOTFOUND, got %08x\n", hr);
|
||||
"Expected DISP_E_PARAMNOTFOUND, got %08lx\n", hr);
|
||||
ok(err_index == 0xdeadbeef,
|
||||
"Expected err_index to be unchanged, got %d\n", err_index);
|
||||
|
||||
|
@ -116,7 +116,7 @@ static void test_DispGetParam(void)
|
|||
VariantInit(&result);
|
||||
hr = DispGetParam(&dispparams, 0, VT_I2, &result, NULL);
|
||||
ok(hr == DISP_E_PARAMNOTFOUND,
|
||||
"Expected DISP_E_PARAMNOTFOUND, got %08x\n", hr);
|
||||
"Expected DISP_E_PARAMNOTFOUND, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_EMPTY,
|
||||
"Expected VT_EMPTY, got %08x\n", V_VT(&result));
|
||||
|
||||
|
@ -125,7 +125,7 @@ static void test_DispGetParam(void)
|
|||
VariantInit(&result);
|
||||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 0, VT_I2, &result, &err_index);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_EMPTY,
|
||||
"Expected VT_EMPTY, got %08x\n", V_VT(&result));
|
||||
ok(err_index == 0, "Expected 0, got %d\n", err_index);
|
||||
|
@ -145,7 +145,7 @@ static void test_DispGetParam(void)
|
|||
VariantInit(&result);
|
||||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 2, VT_I2, &result, &err_index);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_I2, "Expected VT_I2, got %08x\n", V_VT(&result));
|
||||
ok(V_I2(&result) == 42, "Expected 42, got %d\n", V_I2(&result));
|
||||
ok(err_index == 0xdeadbeef,
|
||||
|
@ -156,10 +156,10 @@ static void test_DispGetParam(void)
|
|||
VariantInit(&result);
|
||||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 1, VT_I4, &result, &err_index);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_I4, "Expected VT_I4, got %08x\n", V_VT(&result));
|
||||
ok(V_I4(&result) == 1234567890,
|
||||
"Expected 1234567890, got %d\n", V_I4(&result));
|
||||
"Expected 1234567890, got %ld\n", V_I4(&result));
|
||||
ok(err_index == 0xdeadbeef,
|
||||
"Expected err_index to be unchanged, got %d\n", err_index);
|
||||
|
||||
|
@ -168,7 +168,7 @@ static void test_DispGetParam(void)
|
|||
VariantInit(&result);
|
||||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 0, VT_BSTR, &result, &err_index);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_BSTR, "Expected VT_BSTR, got %08x\n", V_VT(&result));
|
||||
ok_bstr(V_BSTR(&result), "Sunshine", "Expected %s, got %s\n");
|
||||
ok(err_index == 0xdeadbeef,
|
||||
|
@ -181,7 +181,7 @@ static void test_DispGetParam(void)
|
|||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 3, VT_I2, &result, &err_index);
|
||||
ok(hr == DISP_E_PARAMNOTFOUND,
|
||||
"Expected DISP_E_PARAMNOTFOUND, got %08x\n", hr);
|
||||
"Expected DISP_E_PARAMNOTFOUND, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_EMPTY,
|
||||
"Expected VT_EMPTY, got %08x\n", V_VT(&result));
|
||||
ok(err_index == 0xdeadbeef,
|
||||
|
@ -191,14 +191,14 @@ static void test_DispGetParam(void)
|
|||
INIT_DISPPARAMS(dispparams, vararg, NULL, 3, 0);
|
||||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 2, VT_I2, NULL, &err_index);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
|
||||
ok(err_index == 0, "Expected 0, got %d\n", err_index);
|
||||
|
||||
/* puArgErr is NULL. */
|
||||
INIT_DISPPARAMS(dispparams, vararg, NULL, 3, 0);
|
||||
VariantInit(&result);
|
||||
hr = DispGetParam(&dispparams, 2, VT_I2, &result, NULL);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_I2, "Expected VT_I2, got %08x\n", V_VT(&result));
|
||||
ok(V_I2(&result) == 42, "Expected 42, got %d\n", V_I2(&result));
|
||||
|
||||
|
@ -207,9 +207,9 @@ static void test_DispGetParam(void)
|
|||
VariantInit(&result);
|
||||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 2, VT_I4, &result, &err_index);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_I4, "Expected VT_I4, got %08x\n", V_VT(&result));
|
||||
ok(V_I4(&result) == 42, "Expected 42, got %d\n", V_I4(&result));
|
||||
ok(V_I4(&result) == 42, "Expected 42, got %ld\n", V_I4(&result));
|
||||
ok(err_index == 0xdeadbeef,
|
||||
"Expected err_index to be unchanged, got %d\n", err_index);
|
||||
|
||||
|
@ -218,7 +218,7 @@ static void test_DispGetParam(void)
|
|||
VariantInit(&result);
|
||||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 2, VT_BSTR, &result, &err_index);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_BSTR, "Expected VT_BSTR, got %08x\n", V_VT(&result));
|
||||
ok_bstr(V_BSTR(&result), "42", "Expected %s, got %s\n");
|
||||
ok(err_index == 0xdeadbeef,
|
||||
|
@ -230,7 +230,7 @@ static void test_DispGetParam(void)
|
|||
VariantInit(&result);
|
||||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 1, VT_I2, &result, &err_index);
|
||||
ok(hr == DISP_E_OVERFLOW, "Expected DISP_E_OVERFLOW, got %08x\n", hr);
|
||||
ok(hr == DISP_E_OVERFLOW, "Expected DISP_E_OVERFLOW, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_EMPTY,
|
||||
"Expected VT_EMPTY, got %08x\n", V_VT(&result));
|
||||
ok(err_index == 1, "Expected 1, got %d\n", err_index);
|
||||
|
@ -241,7 +241,7 @@ static void test_DispGetParam(void)
|
|||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 0, VT_I2, &result, &err_index);
|
||||
ok(hr == DISP_E_TYPEMISMATCH,
|
||||
"Expected DISP_E_TYPEMISMATCH, got %08x\n", hr);
|
||||
"Expected DISP_E_TYPEMISMATCH, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_EMPTY,
|
||||
"Expected VT_EMPTY, got %08x\n", V_VT(&result));
|
||||
ok(err_index == 2, "Expected 2, got %d\n", err_index);
|
||||
|
@ -251,7 +251,7 @@ static void test_DispGetParam(void)
|
|||
VariantInit(&result);
|
||||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 2, VT_ILLEGAL, &result, &err_index);
|
||||
ok(hr == DISP_E_BADVARTYPE, "Expected DISP_E_BADVARTYPE, got %08x\n", hr);
|
||||
ok(hr == DISP_E_BADVARTYPE, "Expected DISP_E_BADVARTYPE, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_EMPTY,
|
||||
"Expected VT_EMPTY, got %08x\n", V_VT(&result));
|
||||
ok(err_index == 0, "Expected 0, got %d\n", err_index);
|
||||
|
@ -264,7 +264,7 @@ static void test_DispGetParam(void)
|
|||
VariantInit(&result);
|
||||
err_index = 0xdeadbeef;
|
||||
hr = DispGetParam(&dispparams, 0, VT_BSTR, &result, &err_index);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
|
||||
ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
|
||||
ok(V_VT(&result) == VT_BSTR, "Expected VT_BSTR, got %08x\n", V_VT(&result));
|
||||
ok(err_index == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", err_index);
|
||||
VariantClear(&result);
|
||||
|
@ -312,25 +312,25 @@ static void test_CreateStdDispatch(void)
|
|||
HRESULT hr;
|
||||
|
||||
hr = CreateStdDispatch(NULL, NULL, NULL, NULL);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = CreateStdDispatch(NULL, NULL, NULL, &unk);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = LoadTypeLib(stdole2W, &tl);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
hr = ITypeLib_GetTypeInfoOfGuid(tl, &IID_IUnknown, &ti);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
ITypeLib_Release(tl);
|
||||
|
||||
hr = CreateStdDispatch(NULL, &test_unk, NULL, &unk);
|
||||
ok(hr == E_INVALIDARG, "got %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "got %08lx\n", hr);
|
||||
|
||||
hr = CreateStdDispatch(NULL, NULL, ti, &unk);
|
||||
ok(hr == E_INVALIDARG, "got %08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "got %08lx\n", hr);
|
||||
|
||||
hr = CreateStdDispatch(NULL, &test_unk, ti, &unk);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
IUnknown_Release(unk);
|
||||
|
||||
ITypeInfo_Release(ti);
|
||||
|
|
|
@ -61,13 +61,13 @@ static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOO
|
|||
expected_hr = supported ? S_OK : E_NOINTERFACE;
|
||||
|
||||
hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
|
||||
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
|
||||
ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
|
||||
if (SUCCEEDED(hr))
|
||||
IUnknown_Release(unk);
|
||||
}
|
||||
|
||||
#define EXPECT_HR(hr,hr_exp) \
|
||||
ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp)
|
||||
ok(hr == hr_exp, "got 0x%08lx, expected 0x%08lx\n", hr, hr_exp)
|
||||
|
||||
/* Create a font with cySize given by lo_size, hi_size, */
|
||||
/* SetRatio to ratio_logical, ratio_himetric, */
|
||||
|
@ -97,35 +97,35 @@ static void test_ifont_size(LONGLONG size, LONG ratio_logical, LONG ratio_himetr
|
|||
/* Create font, test that it worked. */
|
||||
hres = pOleCreateFontIndirect(&fd, &IID_IFont, &pvObj);
|
||||
ifnt = pvObj;
|
||||
ok(hres == S_OK,"%s: OCFI returns 0x%08x instead of S_OK.\n",
|
||||
ok(hres == S_OK,"%s: OCFI returns 0x%08lx instead of S_OK.\n",
|
||||
test_name, hres);
|
||||
ok(pvObj != NULL,"%s: OCFI returns NULL.\n", test_name);
|
||||
|
||||
/* Change the scaling ratio */
|
||||
hres = IFont_SetRatio(ifnt, ratio_logical, ratio_himetric);
|
||||
ok((ratio_logical && ratio_himetric) ? hres == S_OK : hres == E_FAIL,
|
||||
"%s: IFont_SetRatio unexpectedly returned 0x%08x.\n", test_name, hres);
|
||||
"%s: IFont_SetRatio unexpectedly returned 0x%08lx.\n", test_name, hres);
|
||||
|
||||
/* Read back size. */
|
||||
hres = IFont_get_Size(ifnt, &psize);
|
||||
ok(hres == S_OK,"%s: IFont_get_size returns 0x%08x instead of S_OK.\n",
|
||||
ok(hres == S_OK,"%s: IFont_get_size returns 0x%08lx instead of S_OK.\n",
|
||||
test_name, hres);
|
||||
|
||||
/* Check returned size - allow for errors due to rounding & font realization. */
|
||||
ok((psize.int64 - size) < 10000 && (psize.int64 - size) > -10000,
|
||||
"%s: IFont_get_Size: Lo=%d, Hi=%d; expected Lo=%d, Hi=%d.\n",
|
||||
"%s: IFont_get_Size: Lo=%ld, Hi=%ld; expected Lo=%ld, Hi=%ld.\n",
|
||||
test_name, S(psize).Lo, S(psize).Hi, fd.cySize.Lo, fd.cySize.Hi);
|
||||
|
||||
/* Check hFont size. */
|
||||
hres = IFont_get_hFont (ifnt, &hfont);
|
||||
ok(hres == S_OK, "%s: IFont_get_hFont returns 0x%08x instead of S_OK.\n",
|
||||
ok(hres == S_OK, "%s: IFont_get_hFont returns 0x%08lx instead of S_OK.\n",
|
||||
test_name, hres);
|
||||
rtnval = GetObjectA(hfont, sizeof(LOGFONTA), &lf);
|
||||
ok(rtnval > 0, "GetObject(hfont) failed\n");
|
||||
|
||||
/* Since font scaling may encounter rounding errors, allow 1 pixel deviation. */
|
||||
ok(abs(lf.lfHeight - hfont_height) <= 1,
|
||||
"%s: hFont has lf.lfHeight=%d, expected %d.\n",
|
||||
"%s: hFont has lf.lfHeight=%ld, expected %ld.\n",
|
||||
test_name, lf.lfHeight, hfont_height);
|
||||
|
||||
/* Free IFont. */
|
||||
|
@ -154,7 +154,7 @@ static void test_ifont_sizes(void)
|
|||
test_ifont_size(180000, 0, 0, -30, "default"); /* normal font */
|
||||
test_ifont_size(186000, 0, 0, -31, "rounding"); /* test rounding */
|
||||
} else
|
||||
skip("Skipping resolution dependent font size tests - display resolution is %d\n", dpi);
|
||||
skip("Skipping resolution dependent font size tests - display resolution is %ld\n", dpi);
|
||||
|
||||
/* Next 4 tests specify a scaling ratio, so display resolution is not a factor. */
|
||||
test_ifont_size(180000, 72, 2540, -18, "ratio1"); /* change ratio */
|
||||
|
@ -240,11 +240,11 @@ static void test_type_info(void)
|
|||
fontdisp = pvObj;
|
||||
|
||||
hres = IFontDisp_GetTypeInfo(fontdisp, 0, en_us, &pTInfo);
|
||||
ok(hres == S_OK, "GTI returned 0x%08x instead of S_OK.\n", hres);
|
||||
ok(hres == S_OK, "GTI returned 0x%08lx instead of S_OK.\n", hres);
|
||||
ok(pTInfo != NULL, "GTI returned NULL.\n");
|
||||
|
||||
hres = ITypeInfo_GetNames(pTInfo, DISPID_FONT_NAME, names, 3, &n);
|
||||
ok(hres == S_OK, "GetNames returned 0x%08x instead of S_OK.\n", hres);
|
||||
ok(hres == S_OK, "GetNames returned 0x%08lx instead of S_OK.\n", hres);
|
||||
ok(n == 1, "GetNames returned %d names instead of 1.\n", n);
|
||||
ok(!lstrcmpiW(names[0],name_Name), "DISPID_FONT_NAME doesn't get 'Names'.\n");
|
||||
SysFreeString(names[0]);
|
||||
|
@ -259,7 +259,7 @@ static void test_type_info(void)
|
|||
hres = IFontDisp_Invoke(fontdisp, DISPID_FONT_NAME, &IID_NULL,
|
||||
LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dispparams, &varresult,
|
||||
NULL, NULL);
|
||||
ok(hres == S_OK, "IFontDisp_Invoke return 0x%08x instead of S_OK.\n", hres);
|
||||
ok(hres == S_OK, "IFontDisp_Invoke return 0x%08lx instead of S_OK.\n", hres);
|
||||
VariantClear(&varresult);
|
||||
|
||||
IFontDisp_Release(fontdisp);
|
||||
|
@ -327,7 +327,7 @@ static HRESULT WINAPI FontEventsDisp_Invoke(
|
|||
{
|
||||
VARIANTARG *arg0 = &pDispParams->rgvarg[0];
|
||||
|
||||
ok(dispid == DISPID_FONT_CHANGED, "expected DISPID_FONT_CHANGED instead of 0x%x\n", dispid);
|
||||
ok(dispid == DISPID_FONT_CHANGED, "expected DISPID_FONT_CHANGED instead of 0x%lx\n", dispid);
|
||||
ok(IsEqualGUID(riid, &GUID_NULL), "got riid %s\n", wine_dbgstr_guid(riid));
|
||||
ok(wFlags == INVOKE_FUNC, "expected INVOKE_FUNC instead of 0x%x\n", wFlags);
|
||||
ok(pDispParams->cArgs == 1, "expected arg count 1, got %d\n", pDispParams->cArgs);
|
||||
|
@ -470,12 +470,12 @@ static void test_font_events_disp(void)
|
|||
dispparams.rgvarg = &vararg;
|
||||
fonteventsdisp_invoke_called = 0;
|
||||
hr = IFontDisp_Invoke(pFontDisp, font_dispids[i].dispid, &IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, NULL);
|
||||
ok(hr == S_OK, "dispid=%d, got 0x%08x\n", font_dispids[i].dispid, hr);
|
||||
ok(fonteventsdisp_invoke_called == 1, "dispid=%d, DISPID_FONT_CHANGED not called, got %d\n", font_dispids[i].dispid,
|
||||
ok(hr == S_OK, "dispid=%ld, got 0x%08lx\n", font_dispids[i].dispid, hr);
|
||||
ok(fonteventsdisp_invoke_called == 1, "dispid=%ld, DISPID_FONT_CHANGED not called, got %d\n", font_dispids[i].dispid,
|
||||
fonteventsdisp_invoke_called);
|
||||
if (hr == S_OK)
|
||||
{
|
||||
ok(!lstrcmpW(font_dispids[i].name, fonteventsdisp_invoke_arg0), "dispid=%d, got %s, expected %s\n",
|
||||
ok(!lstrcmpW(font_dispids[i].name, fonteventsdisp_invoke_arg0), "dispid=%ld, got %s, expected %s\n",
|
||||
font_dispids[i].dispid, wine_dbgstr_w(fonteventsdisp_invoke_arg0), wine_dbgstr_w(font_dispids[i].name));
|
||||
SysFreeString(fonteventsdisp_invoke_arg0);
|
||||
}
|
||||
|
@ -516,19 +516,19 @@ static void test_names_ids(WCHAR* w_name_1, const char* a_name_1,
|
|||
|
||||
/* test hres */
|
||||
ok(hres == hres_expect,
|
||||
"GetIDsOfNames: \"%s\", \"%s\" returns 0x%08x, expected 0x%08x.\n",
|
||||
"GetIDsOfNames: \"%s\", \"%s\" returns 0x%08lx, expected 0x%08lx.\n",
|
||||
a_name_1, a_name_2, hres, hres_expect);
|
||||
|
||||
/* test first DISPID */
|
||||
ok(rgDispId[0]==id_1,
|
||||
"GetIDsOfNames: \"%s\" gets DISPID 0x%08x, expected 0x%08x.\n",
|
||||
"GetIDsOfNames: \"%s\" gets DISPID 0x%08lx, expected 0x%08lx.\n",
|
||||
a_name_1, rgDispId[0], id_1);
|
||||
|
||||
/* test second DISPID is present */
|
||||
if (numnames == 2)
|
||||
{
|
||||
ok(rgDispId[1]==id_2,
|
||||
"GetIDsOfNames: ..., \"%s\" gets DISPID 0x%08x, expected 0x%08x.\n",
|
||||
"GetIDsOfNames: ..., \"%s\" gets DISPID 0x%08lx, expected 0x%08lx.\n",
|
||||
a_name_2, rgDispId[1], id_2);
|
||||
}
|
||||
|
||||
|
@ -679,20 +679,20 @@ static void test_IsEqual(void)
|
|||
pOleCreateFontIndirect(&fd, &IID_IFont, (void **)&ifnt2);
|
||||
hres = IFont_IsEqual(ifnt,ifnt2);
|
||||
ok(hres == S_OK,
|
||||
"IFont_IsEqual: (EQUAL) Expected S_OK but got 0x%08x\n",hres);
|
||||
"IFont_IsEqual: (EQUAL) Expected S_OK but got 0x%08lx\n",hres);
|
||||
IFont_Release(ifnt2);
|
||||
|
||||
/* Check for bad pointer */
|
||||
hres = IFont_IsEqual(ifnt,NULL);
|
||||
ok(hres == E_POINTER,
|
||||
"IFont_IsEqual: (NULL) Expected 0x80004003 but got 0x%08x\n",hres);
|
||||
"IFont_IsEqual: (NULL) Expected 0x80004003 but got 0x%08lx\n",hres);
|
||||
|
||||
/* Test strName */
|
||||
fd.lpstrName = arial_font;
|
||||
pOleCreateFontIndirect(&fd, &IID_IFont, (void **)&ifnt2);
|
||||
hres = IFont_IsEqual(ifnt,ifnt2);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_IsEqual: (strName) Expected S_FALSE but got 0x%08x\n",hres);
|
||||
"IFont_IsEqual: (strName) Expected S_FALSE but got 0x%08lx\n",hres);
|
||||
fd.lpstrName = system_font;
|
||||
IFont_Release(ifnt2);
|
||||
|
||||
|
@ -701,7 +701,7 @@ static void test_IsEqual(void)
|
|||
pOleCreateFontIndirect(&fd, &IID_IFont, (void **)&ifnt2);
|
||||
hres = IFont_IsEqual(ifnt,ifnt2);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_IsEqual: (Lo font size) Expected S_FALSE but got 0x%08x\n",hres);
|
||||
"IFont_IsEqual: (Lo font size) Expected S_FALSE but got 0x%08lx\n",hres);
|
||||
S(fd.cySize).Lo = 100;
|
||||
IFont_Release(ifnt2);
|
||||
|
||||
|
@ -710,7 +710,7 @@ static void test_IsEqual(void)
|
|||
pOleCreateFontIndirect(&fd, &IID_IFont, (void **)&ifnt2);
|
||||
hres = IFont_IsEqual(ifnt,ifnt2);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_IsEqual: (Hi font size) Expected S_FALSE but got 0x%08x\n",hres);
|
||||
"IFont_IsEqual: (Hi font size) Expected S_FALSE but got 0x%08lx\n",hres);
|
||||
S(fd.cySize).Hi = 100;
|
||||
IFont_Release(ifnt2);
|
||||
|
||||
|
@ -719,7 +719,7 @@ static void test_IsEqual(void)
|
|||
pOleCreateFontIndirect(&fd, &IID_IFont, (void **)&ifnt2);
|
||||
hres = IFont_IsEqual(ifnt,ifnt2);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_IsEqual: (Weight) Expected S_FALSE but got 0x%08x\n",hres);
|
||||
"IFont_IsEqual: (Weight) Expected S_FALSE but got 0x%08lx\n",hres);
|
||||
fd.sWeight = 0;
|
||||
IFont_Release(ifnt2);
|
||||
|
||||
|
@ -728,7 +728,7 @@ static void test_IsEqual(void)
|
|||
pOleCreateFontIndirect(&fd, &IID_IFont, (void **)&ifnt2);
|
||||
hres = IFont_IsEqual(ifnt,ifnt2);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_IsEqual: (Charset) Expected S_FALSE but got 0x%08x\n",hres);
|
||||
"IFont_IsEqual: (Charset) Expected S_FALSE but got 0x%08lx\n",hres);
|
||||
fd.sCharset = 0;
|
||||
IFont_Release(ifnt2);
|
||||
|
||||
|
@ -737,7 +737,7 @@ static void test_IsEqual(void)
|
|||
pOleCreateFontIndirect(&fd, &IID_IFont, (void **)&ifnt2);
|
||||
hres = IFont_IsEqual(ifnt,ifnt2);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_IsEqual: (Italic) Expected S_FALSE but got 0x%08x\n",hres);
|
||||
"IFont_IsEqual: (Italic) Expected S_FALSE but got 0x%08lx\n",hres);
|
||||
fd.fItalic = FALSE;
|
||||
IFont_Release(ifnt2);
|
||||
|
||||
|
@ -746,7 +746,7 @@ static void test_IsEqual(void)
|
|||
pOleCreateFontIndirect(&fd, &IID_IFont, (void **)&ifnt2);
|
||||
hres = IFont_IsEqual(ifnt,ifnt2);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_IsEqual: (Underline) Expected S_FALSE but got 0x%08x\n",hres);
|
||||
"IFont_IsEqual: (Underline) Expected S_FALSE but got 0x%08lx\n",hres);
|
||||
fd.fUnderline = FALSE;
|
||||
IFont_Release(ifnt2);
|
||||
|
||||
|
@ -755,7 +755,7 @@ static void test_IsEqual(void)
|
|||
pOleCreateFontIndirect(&fd, &IID_IFont, (void **)&ifnt2);
|
||||
hres = IFont_IsEqual(ifnt,ifnt2);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_IsEqual: (Strikethrough) Expected S_FALSE but got 0x%08x\n",hres);
|
||||
"IFont_IsEqual: (Strikethrough) Expected S_FALSE but got 0x%08lx\n",hres);
|
||||
fd.fStrikethrough = FALSE;
|
||||
IFont_Release(ifnt2);
|
||||
|
||||
|
@ -797,36 +797,36 @@ static void test_ReleaseHfont(void)
|
|||
/* Try invalid HFONT */
|
||||
hres = IFont_ReleaseHfont(ifnt1,NULL);
|
||||
ok(hres == E_INVALIDARG,
|
||||
"IFont_ReleaseHfont: (Bad HFONT) Expected E_INVALIDARG but got 0x%08x\n",
|
||||
"IFont_ReleaseHfont: (Bad HFONT) Expected E_INVALIDARG but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Try to add a bad HFONT */
|
||||
hres = IFont_ReleaseHfont(ifnt1,(HFONT)32);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_ReleaseHfont: (Bad HFONT) Expected S_FALSE but got 0x%08x\n",
|
||||
"IFont_ReleaseHfont: (Bad HFONT) Expected S_FALSE but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Release all refs */
|
||||
hres = IFont_ReleaseHfont(ifnt1,hfnt1);
|
||||
ok(hres == S_OK,
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
hres = IFont_ReleaseHfont(ifnt2,hfnt2);
|
||||
ok(hres == S_OK,
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Check that both lists are empty */
|
||||
hres = IFont_ReleaseHfont(ifnt1,hfnt1);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* The list should be empty */
|
||||
hres = IFont_ReleaseHfont(ifnt2,hfnt2);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
IFont_Release(ifnt1);
|
||||
|
@ -865,59 +865,59 @@ static void test_AddRefHfont(void)
|
|||
/* Try invalid HFONT */
|
||||
hres = IFont_AddRefHfont(ifnt1,NULL);
|
||||
ok(hres == E_INVALIDARG,
|
||||
"IFont_AddRefHfont: (Bad HFONT) Expected E_INVALIDARG but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Bad HFONT) Expected E_INVALIDARG but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Try to add a bad HFONT */
|
||||
hres = IFont_AddRefHfont(ifnt1,(HFONT)32);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_AddRefHfont: (Bad HFONT) Expected S_FALSE but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Bad HFONT) Expected S_FALSE but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Add simple IFONT HFONT pair */
|
||||
hres = IFont_AddRefHfont(ifnt1,hfnt1);
|
||||
ok(hres == S_OK,
|
||||
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* IFONT and HFONT do not have to be the same (always looks at HFONT) */
|
||||
hres = IFont_AddRefHfont(ifnt2,hfnt1);
|
||||
ok(hres == S_OK,
|
||||
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Release all hfnt1 refs */
|
||||
hres = IFont_ReleaseHfont(ifnt1,hfnt1);
|
||||
ok(hres == S_OK,
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
hres = IFont_ReleaseHfont(ifnt1,hfnt1);
|
||||
ok(hres == S_OK,
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
hres = IFont_ReleaseHfont(ifnt1,hfnt1);
|
||||
ok(hres == S_OK,
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Check if hfnt1 is empty */
|
||||
hres = IFont_ReleaseHfont(ifnt1,hfnt1);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Release all hfnt2 refs */
|
||||
hres = IFont_ReleaseHfont(ifnt2,hfnt2);
|
||||
ok(hres == S_OK,
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Check if hfnt2 is empty */
|
||||
hres = IFont_ReleaseHfont(ifnt2,hfnt2);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_FALSE but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Show that releasing an IFONT does not always release it from the HFONT cache. */
|
||||
|
@ -927,14 +927,14 @@ static void test_AddRefHfont(void)
|
|||
/* Add a reference for destroyed hfnt1 */
|
||||
hres = IFont_AddRefHfont(ifnt2,hfnt1);
|
||||
ok(hres == S_OK,
|
||||
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Decrement reference for destroyed hfnt1 */
|
||||
hres = IFont_ReleaseHfont(ifnt2,hfnt1);
|
||||
ok(hres == S_OK ||
|
||||
hres == S_FALSE, /* <= win2k */
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK or S_FALSE but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK or S_FALSE but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Shows that releasing all IFONT's does clear the HFONT cache. */
|
||||
|
@ -949,13 +949,13 @@ static void test_AddRefHfont(void)
|
|||
/* Add a reference for destroyed hfnt1 */
|
||||
hres = IFont_AddRefHfont(ifnt3,hfnt1);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Add ref) Expected S_OK but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
/* Decrement reference for destroyed hfnt1 */
|
||||
hres = IFont_ReleaseHfont(ifnt3,hfnt1);
|
||||
ok(hres == S_FALSE,
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08x\n",
|
||||
"IFont_AddRefHfont: (Release ref) Expected S_OK but got 0x%08lx\n",
|
||||
hres);
|
||||
|
||||
IFont_Release(ifnt3);
|
||||
|
@ -1028,14 +1028,14 @@ static void test_hfont_lifetime(void)
|
|||
size.int64 = (i + 10) * 20000;
|
||||
|
||||
obj_type = GetObjectType(hfont);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %d\n", obj_type);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %ld\n", obj_type);
|
||||
|
||||
hr = IFont_put_Size(font, size);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
/* put_Size doesn't cause the new font to be realized */
|
||||
obj_type = GetObjectType(last_hfont);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %d\n", obj_type);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %ld\n", obj_type);
|
||||
|
||||
hr = IFont_get_hFont(font, &hfont);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
@ -1048,7 +1048,7 @@ static void test_hfont_lifetime(void)
|
|||
size.int64 = (i + 10) * 20000;
|
||||
|
||||
obj_type = GetObjectType(hfont);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %d\n", obj_type);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %ld\n", obj_type);
|
||||
|
||||
hr = IFont_put_Size(font, size);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
@ -1061,7 +1061,7 @@ static void test_hfont_lifetime(void)
|
|||
|
||||
if(i == 0) first_hfont = hfont;
|
||||
obj_type = GetObjectType(first_hfont);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %d\n", obj_type);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %ld\n", obj_type);
|
||||
}
|
||||
|
||||
IFont_Release(font);
|
||||
|
@ -1082,14 +1082,14 @@ static void test_hfont_lifetime(void)
|
|||
size.int64 = (i + 10) * 20000;
|
||||
|
||||
obj_type = GetObjectType(hfont);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %d\n", obj_type);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %ld\n", obj_type);
|
||||
|
||||
hr = IFont_put_Size(font, size);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
/* put_Size doesn't cause the new font to be realized */
|
||||
obj_type = GetObjectType(last_hfont);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %d\n", obj_type);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %ld\n", obj_type);
|
||||
|
||||
hr = IFont_get_hFont(font, &hfont);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
@ -1109,7 +1109,7 @@ static void test_hfont_lifetime(void)
|
|||
size.int64 = (i + 10) * 20000;
|
||||
|
||||
obj_type = GetObjectType(hfont);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %d\n", obj_type);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %ld\n", obj_type);
|
||||
|
||||
hr = IFont_put_Size(font, size);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
@ -1122,7 +1122,7 @@ static void test_hfont_lifetime(void)
|
|||
|
||||
if(i == 0) first_hfont = hfont;
|
||||
obj_type = GetObjectType(first_hfont);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %d\n", obj_type);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %ld\n", obj_type);
|
||||
}
|
||||
|
||||
IFont_Release(font);
|
||||
|
@ -1151,12 +1151,12 @@ static void test_hfont_lifetime(void)
|
|||
EXPECT_HR(hr, S_FALSE);
|
||||
|
||||
obj_type = GetObjectType(hfont);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %d\n", obj_type);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %ld\n", obj_type);
|
||||
|
||||
IFont_Release(font);
|
||||
|
||||
obj_type = GetObjectType(hfont);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %d\n", obj_type);
|
||||
ok(obj_type == OBJ_FONT, "got obj type %ld\n", obj_type);
|
||||
|
||||
IFont_Release(font2);
|
||||
}
|
||||
|
@ -1255,13 +1255,13 @@ static void test_OleCreateFontIndirect(void)
|
|||
IFont_Release(font);
|
||||
|
||||
hr = OleInitialize(NULL);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = CoGetClassObject(&CLSID_StdFont, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)&unk);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void**)&unk2);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
IUnknown_Release(unk);
|
||||
IUnknown_Release(unk2);
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
#define ole_expect(expr, expect) { \
|
||||
HRESULT r = expr; \
|
||||
ok(r == (expect), #expr " returned %x, expected %s (%x)\n", r, #expect, expect); \
|
||||
ok(r == (expect), #expr " returned %lx, expected %s (%lx)\n", r, #expect, expect); \
|
||||
}
|
||||
|
||||
#define ole_check(expr) ole_expect(expr, S_OK);
|
||||
|
@ -56,7 +56,7 @@ static HMODULE hOleaut32;
|
|||
static HRESULT (WINAPI *pOleLoadPicture)(LPSTREAM,LONG,BOOL,REFIID,LPVOID*);
|
||||
static HRESULT (WINAPI *pOleLoadPictureEx)(LPSTREAM,LONG,BOOL,REFIID,DWORD,DWORD,DWORD,LPVOID*);
|
||||
|
||||
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
|
||||
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error %#08lx\n", hr)
|
||||
|
||||
/* 1x1 pixel gif */
|
||||
static const unsigned char gifimage[35] = {
|
||||
|
@ -218,7 +218,7 @@ test_pic_with_stream(LPSTREAM stream, unsigned int imgsize)
|
|||
hres = pOleLoadPicture(stream, imgsize, TRUE, &IID_IPicture, &pvObj);
|
||||
pic = pvObj;
|
||||
|
||||
ok(hres == S_OK,"OLP (NULL,..) does not return 0, but 0x%08x\n",hres);
|
||||
ok(hres == S_OK,"OLP (NULL,..) does not return 0, but 0x%08lx\n",hres);
|
||||
ok(pic != NULL,"OLP (NULL,..) returns NULL, instead of !NULL\n");
|
||||
if (pic == NULL)
|
||||
return;
|
||||
|
@ -226,14 +226,14 @@ test_pic_with_stream(LPSTREAM stream, unsigned int imgsize)
|
|||
pvObj = NULL;
|
||||
hres = IPicture_QueryInterface (pic, &IID_IPicture, &pvObj);
|
||||
|
||||
ok(hres == S_OK,"IPicture_QI does not return S_OK, but 0x%08x\n", hres);
|
||||
ok(hres == S_OK,"IPicture_QI does not return S_OK, but 0x%08lx\n", hres);
|
||||
ok(pvObj != NULL,"IPicture_QI does return NULL, instead of a ptr\n");
|
||||
|
||||
IPicture_Release ((IPicture*)pvObj);
|
||||
|
||||
handle = 0;
|
||||
hres = IPicture_get_Handle (pic, &handle);
|
||||
ok(hres == S_OK,"IPicture_get_Handle does not return S_OK, but 0x%08x\n", hres);
|
||||
ok(hres == S_OK,"IPicture_get_Handle does not return S_OK, but 0x%08lx\n", hres);
|
||||
ok(handle != 0, "IPicture_get_Handle returns a NULL handle, but it should be non NULL\n");
|
||||
|
||||
if (handle)
|
||||
|
@ -245,32 +245,32 @@ test_pic_with_stream(LPSTREAM stream, unsigned int imgsize)
|
|||
|
||||
width = 0;
|
||||
hres = IPicture_get_Width (pic, &width);
|
||||
ok(hres == S_OK,"IPicture_get_Width does not return S_OK, but 0x%08x\n", hres);
|
||||
ok(hres == S_OK,"IPicture_get_Width does not return S_OK, but 0x%08lx\n", hres);
|
||||
ok(width != 0, "IPicture_get_Width returns 0, but it should not be 0.\n");
|
||||
|
||||
height = 0;
|
||||
hres = IPicture_get_Height (pic, &height);
|
||||
ok(hres == S_OK,"IPicture_get_Height does not return S_OK, but 0x%08x\n", hres);
|
||||
ok(hres == S_OK,"IPicture_get_Height does not return S_OK, but 0x%08lx\n", hres);
|
||||
ok(height != 0, "IPicture_get_Height returns 0, but it should not be 0.\n");
|
||||
|
||||
type = 0;
|
||||
hres = IPicture_get_Type (pic, &type);
|
||||
ok(hres == S_OK,"IPicture_get_Type does not return S_OK, but 0x%08x\n", hres);
|
||||
ok(hres == S_OK,"IPicture_get_Type does not return S_OK, but 0x%08lx\n", hres);
|
||||
ok(type == PICTYPE_BITMAP, "IPicture_get_Type returns %d, but it should be PICTYPE_BITMAP(%d).\n", type, PICTYPE_BITMAP);
|
||||
|
||||
attr = 0;
|
||||
hres = IPicture_get_Attributes (pic, &attr);
|
||||
ok(hres == S_OK,"IPicture_get_Attributes does not return S_OK, but 0x%08x\n", hres);
|
||||
ok(attr == 0, "IPicture_get_Attributes returns %d, but it should be 0.\n", attr);
|
||||
ok(hres == S_OK,"IPicture_get_Attributes does not return S_OK, but 0x%08lx\n", hres);
|
||||
ok(attr == 0, "IPicture_get_Attributes returns %ld, but it should be 0.\n", attr);
|
||||
|
||||
hPal = 0;
|
||||
hres = IPicture_get_hPal (pic, &hPal);
|
||||
ok(hres == S_OK,"IPicture_get_hPal does not return S_OK, but 0x%08x\n", hres);
|
||||
ok(hres == S_OK,"IPicture_get_hPal does not return S_OK, but 0x%08lx\n", hres);
|
||||
/* a single pixel b/w image has no palette */
|
||||
ok(hPal == 0, "IPicture_get_hPal returns %d, but it should be 0.\n", hPal);
|
||||
|
||||
res = IPicture_Release (pic);
|
||||
ok (res == 0, "refcount after release is %d, but should be 0?\n", res);
|
||||
ok (res == 0, "refcount after release is %ld, but should be 0?\n", res);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -292,11 +292,11 @@ test_pic(const unsigned char *imgdata, unsigned int imgsize)
|
|||
GlobalUnlock(hglob); data = NULL;
|
||||
|
||||
hres = CreateStreamOnHGlobal (hglob, FALSE, &stream);
|
||||
ok (hres == S_OK, "createstreamonhglobal failed? doubt it... hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK, "createstreamonhglobal failed? doubt it... hres 0x%08lx\n", hres);
|
||||
|
||||
memset(&seekto,0,sizeof(seekto));
|
||||
hres = IStream_Seek(stream,seekto,SEEK_CUR,&newpos1);
|
||||
ok (hres == S_OK, "istream seek failed? doubt it... hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK, "istream seek failed? doubt it... hres 0x%08lx\n", hres);
|
||||
test_pic_with_stream(stream, imgsize);
|
||||
|
||||
IStream_Release(stream);
|
||||
|
@ -323,11 +323,11 @@ test_pic(const unsigned char *imgdata, unsigned int imgsize)
|
|||
GlobalUnlock(hglob); data = NULL;
|
||||
|
||||
hres = CreateStreamOnHGlobal (hglob, FALSE, &stream);
|
||||
ok (hres == S_OK, "createstreamonhglobal failed? doubt it... hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK, "createstreamonhglobal failed? doubt it... hres 0x%08lx\n", hres);
|
||||
|
||||
memset(&seekto,0,sizeof(seekto));
|
||||
hres = IStream_Seek(stream,seekto,SEEK_CUR,&newpos1);
|
||||
ok (hres == S_OK, "istream seek failed? doubt it... hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK, "istream seek failed? doubt it... hres 0x%08lx\n", hres);
|
||||
test_pic_with_stream(stream, imgsize);
|
||||
|
||||
IStream_Release(stream);
|
||||
|
@ -360,29 +360,29 @@ static void test_empty_image(void) {
|
|||
memcpy(data,"lt\0\0",4);
|
||||
((DWORD*)data)[1] = 0;
|
||||
hres = CreateStreamOnHGlobal (hglob, TRUE, &stream);
|
||||
ok (hres == S_OK, "CreatestreamOnHGlobal failed? doubt it... hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK, "CreatestreamOnHGlobal failed? doubt it... hres 0x%08lx\n", hres);
|
||||
|
||||
memset(&seekto,0,sizeof(seekto));
|
||||
hres = IStream_Seek(stream,seekto,SEEK_CUR,&newpos1);
|
||||
ok (hres == S_OK, "istream seek failed? doubt it... hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK, "istream seek failed? doubt it... hres 0x%08lx\n", hres);
|
||||
|
||||
pvObj = NULL;
|
||||
hres = pOleLoadPicture(stream, 8, TRUE, &IID_IPicture, &pvObj);
|
||||
pic = pvObj;
|
||||
ok(hres == S_OK,"empty picture not loaded, hres 0x%08x\n", hres);
|
||||
ok(hres == S_OK,"empty picture not loaded, hres 0x%08lx\n", hres);
|
||||
ok(pic != NULL,"empty picture not loaded, pic is NULL\n");
|
||||
|
||||
hres = IPicture_get_Type (pic, &type);
|
||||
ok (hres == S_OK,"empty picture get type failed with hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK,"empty picture get type failed with hres 0x%08lx\n", hres);
|
||||
ok (type == PICTYPE_NONE,"type is %d, but should be PICTYPE_NONE(0)\n", type);
|
||||
|
||||
attr = 0xdeadbeef;
|
||||
hres = IPicture_get_Attributes (pic, &attr);
|
||||
ok (hres == S_OK,"empty picture get attributes failed with hres 0x%08x\n", hres);
|
||||
ok (attr == 0,"attr is %d, but should be 0\n", attr);
|
||||
ok (hres == S_OK,"empty picture get attributes failed with hres 0x%08lx\n", hres);
|
||||
ok (attr == 0,"attr is %ld, but should be 0\n", attr);
|
||||
|
||||
hres = IPicture_get_Handle (pic, &handle);
|
||||
ok (hres == S_OK,"empty picture get handle failed with hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK,"empty picture get handle failed with hres 0x%08lx\n", hres);
|
||||
ok (handle == 0, "empty picture get handle did not return 0, but 0x%08x\n", handle);
|
||||
IPicture_Release (pic);
|
||||
IStream_Release (stream);
|
||||
|
@ -406,21 +406,21 @@ static void test_empty_image_2(void) {
|
|||
memcpy(data,"lt\0\0",4);
|
||||
((DWORD*)data)[1] = 0;
|
||||
hres = CreateStreamOnHGlobal (hglob, TRUE, &stream);
|
||||
ok (hres == S_OK, "CreatestreamOnHGlobal failed? doubt it... hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK, "CreatestreamOnHGlobal failed? doubt it... hres 0x%08lx\n", hres);
|
||||
|
||||
memset(&seekto,0,sizeof(seekto));
|
||||
seekto.u.LowPart = 42;
|
||||
hres = IStream_Seek(stream,seekto,SEEK_CUR,&newpos1);
|
||||
ok (hres == S_OK, "istream seek failed? doubt it... hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK, "istream seek failed? doubt it... hres 0x%08lx\n", hres);
|
||||
|
||||
pvObj = NULL;
|
||||
hres = pOleLoadPicture(stream, 8, TRUE, &IID_IPicture, &pvObj);
|
||||
pic = pvObj;
|
||||
ok(hres == S_OK,"empty picture not loaded, hres 0x%08x\n", hres);
|
||||
ok(hres == S_OK,"empty picture not loaded, hres 0x%08lx\n", hres);
|
||||
ok(pic != NULL,"empty picture not loaded, pic is NULL\n");
|
||||
|
||||
hres = IPicture_get_Type (pic, &type);
|
||||
ok (hres == S_OK,"empty picture get type failed with hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK,"empty picture get type failed with hres 0x%08lx\n", hres);
|
||||
ok (type == PICTYPE_NONE,"type is %d, but should be PICTYPE_NONE(0)\n", type);
|
||||
|
||||
IPicture_Release (pic);
|
||||
|
@ -460,43 +460,43 @@ static void test_Invoke(void)
|
|||
dispparams.cArgs = 1;
|
||||
dispparams.rgvarg = &vararg;
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_IPictureDisp, 0, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, NULL);
|
||||
ok(hr == DISP_E_UNKNOWNNAME, "IPictureDisp_Invoke should have returned DISP_E_UNKNOWNNAME instead of 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_UNKNOWNNAME, "IPictureDisp_Invoke should have returned DISP_E_UNKNOWNNAME instead of 0x%08lx\n", hr);
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_IUnknown, 0, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, NULL);
|
||||
ok(hr == DISP_E_UNKNOWNNAME, "IPictureDisp_Invoke should have returned DISP_E_UNKNOWNNAME instead of 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_UNKNOWNNAME, "IPictureDisp_Invoke should have returned DISP_E_UNKNOWNNAME instead of 0x%08lx\n", hr);
|
||||
|
||||
dispparams.cArgs = 0;
|
||||
dispparams.rgvarg = NULL;
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, NULL);
|
||||
ok(hr == DISP_E_BADPARAMCOUNT, "IPictureDisp_Invoke should have returned DISP_E_BADPARAMCOUNT instead of 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_BADPARAMCOUNT, "IPictureDisp_Invoke should have returned DISP_E_BADPARAMCOUNT instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_PROPERTYPUT, NULL, NULL, NULL, NULL);
|
||||
ok(hr == DISP_E_PARAMNOTOPTIONAL, "IPictureDisp_Invoke should have returned DISP_E_PARAMNOTOPTIONAL instead of 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_PARAMNOTOPTIONAL, "IPictureDisp_Invoke should have returned DISP_E_PARAMNOTOPTIONAL instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_PROPERTYGET, NULL, NULL, NULL, NULL);
|
||||
ok(hr == DISP_E_PARAMNOTOPTIONAL, "IPictureDisp_Invoke should have returned DISP_E_PARAMNOTOPTIONAL instead of 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_PARAMNOTOPTIONAL, "IPictureDisp_Invoke should have returned DISP_E_PARAMNOTOPTIONAL instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_PROPERTYGET, NULL, &varresult, NULL, NULL);
|
||||
ok(hr == DISP_E_PARAMNOTOPTIONAL, "IPictureDisp_Invoke should have returned DISP_E_PARAMNOTOPTIONAL instead of 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_PARAMNOTOPTIONAL, "IPictureDisp_Invoke should have returned DISP_E_PARAMNOTOPTIONAL instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dispparams, &varresult, NULL, NULL);
|
||||
ok_ole_success(hr, "IPictureDisp_Invoke");
|
||||
ok(V_VT(&varresult) == VT_I4, "V_VT(&varresult) should have been VT_UINT instead of %d\n", V_VT(&varresult));
|
||||
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &varresult, NULL, NULL);
|
||||
ok(hr == DISP_E_MEMBERNOTFOUND, "IPictureDisp_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_MEMBERNOTFOUND, "IPictureDisp_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = IPictureDisp_Invoke(picdisp, 0xdeadbeef, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dispparams, &varresult, NULL, NULL);
|
||||
ok(hr == DISP_E_MEMBERNOTFOUND, "IPictureDisp_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_MEMBERNOTFOUND, "IPictureDisp_Invoke should have returned DISP_E_MEMBERNOTFOUND instead of 0x%08lx\n", hr);
|
||||
|
||||
dispparams.cArgs = 1;
|
||||
dispparams.rgvarg = &vararg;
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dispparams, &varresult, NULL, NULL);
|
||||
ok(hr == DISP_E_BADPARAMCOUNT, "IPictureDisp_Invoke should have returned DISP_E_BADPARAMCOUNT instead of 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_BADPARAMCOUNT, "IPictureDisp_Invoke should have returned DISP_E_BADPARAMCOUNT instead of 0x%08lx\n", hr);
|
||||
|
||||
dispparams.cArgs = 1;
|
||||
dispparams.rgvarg = &vararg;
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_HPAL, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dispparams, &varresult, NULL, NULL);
|
||||
ok(hr == DISP_E_BADPARAMCOUNT, "IPictureDisp_Invoke should have returned DISP_E_BADPARAMCOUNT instead of 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_BADPARAMCOUNT, "IPictureDisp_Invoke should have returned DISP_E_BADPARAMCOUNT instead of 0x%08lx\n", hr);
|
||||
|
||||
/* DISPID_PICT_RENDER */
|
||||
hdc = create_render_dc();
|
||||
|
@ -522,18 +522,18 @@ static void test_Invoke(void)
|
|||
|
||||
V_VT(&varresult) = VT_EMPTY;
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_RENDER, &GUID_NULL, 0, DISPATCH_METHOD, &dispparams, &varresult, NULL, NULL);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
/* Try with one argument set to VT_I2, it'd still work if coerced. */
|
||||
V_VT(&args[3]) = VT_I2;
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_RENDER, &GUID_NULL, 0, DISPATCH_METHOD, &dispparams, &varresult, NULL, NULL);
|
||||
ok(hr == DISP_E_TYPEMISMATCH, "got 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_TYPEMISMATCH, "got 0x%08lx\n", hr);
|
||||
V_VT(&args[3]) = VT_I4;
|
||||
|
||||
/* Wrong argument count */
|
||||
dispparams.cArgs = 9;
|
||||
hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_RENDER, &GUID_NULL, 0, DISPATCH_METHOD, &dispparams, &varresult, NULL, NULL);
|
||||
ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08x\n", hr);
|
||||
ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
|
||||
|
||||
delete_render_dc(hdc);
|
||||
IPictureDisp_Release(picdisp);
|
||||
|
@ -605,22 +605,22 @@ if (0)
|
|||
desc.picType = PICTYPE_UNINITIALIZED;
|
||||
pict = (void *)0xdeadbeef;
|
||||
hr = OleCreatePictureIndirect(&desc, &IID_IPicture, TRUE, (void **)&pict);
|
||||
ok(hr == E_UNEXPECTED, "got %#x\n", hr);
|
||||
ok(hr == E_UNEXPECTED, "got %#lx\n", hr);
|
||||
ok(pict == NULL, "got %p\n", pict);
|
||||
|
||||
for (i = PICTYPE_UNINITIALIZED; i <= PICTYPE_ENHMETAFILE; i++)
|
||||
{
|
||||
hr = create_picture(i, &pict);
|
||||
ok(hr == S_OK, "%d: got %#x\n", i, hr);
|
||||
ok(hr == S_OK, "%d: got %#lx\n", i, hr);
|
||||
|
||||
type = 0xdead;
|
||||
hr = IPicture_get_Type(pict, &type);
|
||||
ok(hr == S_OK, "%d: got %#x\n", i, hr);
|
||||
ok(hr == S_OK, "%d: got %#lx\n", i, hr);
|
||||
ok(type == i, "%d: got %d\n", i, type);
|
||||
|
||||
handle = 0xdeadbeef;
|
||||
hr = IPicture_get_Handle(pict, &handle);
|
||||
ok(hr == S_OK, "%d: got %#x\n", i, hr);
|
||||
ok(hr == S_OK, "%d: got %#lx\n", i, hr);
|
||||
if (type == PICTYPE_UNINITIALIZED || type == PICTYPE_NONE)
|
||||
ok(handle == 0, "%d: got %#x\n", i, handle);
|
||||
else
|
||||
|
@ -630,20 +630,20 @@ if (0)
|
|||
hr = IPicture_get_hPal(pict, &handle);
|
||||
if (type == PICTYPE_BITMAP)
|
||||
{
|
||||
ok(hr == S_OK, "%d: got %#x\n", i, hr);
|
||||
ok(hr == S_OK, "%d: got %#lx\n", i, hr);
|
||||
ok(handle == 0xbeefdead, "%d: got %#x\n", i, handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
ok(hr == E_FAIL, "%d: got %#x\n", i, hr);
|
||||
ok(hr == E_FAIL, "%d: got %#lx\n", i, hr);
|
||||
ok(handle == 0xdeadbeef || handle == 0 /* win64 */, "%d: got %#x\n", i, handle);
|
||||
}
|
||||
|
||||
hr = IPicture_set_hPal(pict, HandleToUlong(GetStockObject(DEFAULT_PALETTE)));
|
||||
if (type == PICTYPE_BITMAP)
|
||||
ok(hr == S_OK, "%d: got %#x\n", i, hr);
|
||||
ok(hr == S_OK, "%d: got %#lx\n", i, hr);
|
||||
else
|
||||
ok(hr == E_FAIL, "%d: got %#x\n", i, hr);
|
||||
ok(hr == E_FAIL, "%d: got %#lx\n", i, hr);
|
||||
|
||||
IPicture_Release(pict);
|
||||
}
|
||||
|
@ -674,13 +674,13 @@ static void test_apm(void)
|
|||
expect_eq(type, PICTYPE_METAFILE, short, "%d");
|
||||
|
||||
ole_check(IPicture_get_Height(pict, &cxy));
|
||||
expect_eq(cxy, 1667, LONG, "%d");
|
||||
expect_eq(cxy, 1667l, LONG, "%ld");
|
||||
|
||||
ole_check(IPicture_get_Width(pict, &cxy));
|
||||
expect_eq(cxy, 1323, LONG, "%d");
|
||||
expect_eq(cxy, 1323l, LONG, "%ld");
|
||||
|
||||
ole_check(IPicture_get_KeepOriginalFormat(pict, &keep));
|
||||
todo_wine expect_eq(keep, FALSE, LONG, "%d");
|
||||
todo_wine expect_eq(keep, (LONG)FALSE, LONG, "%ld");
|
||||
|
||||
ole_expect(IPicture_get_hPal(pict, &handle), E_FAIL);
|
||||
IPicture_Release(pict);
|
||||
|
@ -730,13 +730,13 @@ static void test_enhmetafile(void)
|
|||
expect_eq(type, PICTYPE_ENHMETAFILE, short, "%d");
|
||||
|
||||
ole_check(IPicture_get_Height(pict, &cxy));
|
||||
expect_eq(cxy, -23, LONG, "%d");
|
||||
expect_eq(cxy, -23l, LONG, "%ld");
|
||||
|
||||
ole_check(IPicture_get_Width(pict, &cxy));
|
||||
expect_eq(cxy, -25, LONG, "%d");
|
||||
expect_eq(cxy, -25l, LONG, "%ld");
|
||||
|
||||
ole_check(IPicture_get_KeepOriginalFormat(pict, &keep));
|
||||
todo_wine expect_eq(keep, FALSE, LONG, "%d");
|
||||
todo_wine expect_eq(keep, (LONG)FALSE, LONG, "%ld");
|
||||
|
||||
IPicture_Release(pict);
|
||||
IStream_Release(stream);
|
||||
|
@ -783,7 +783,7 @@ static HRESULT picture_render(IPicture *iface, HDC hdc, LONG x, LONG y, LONG cx,
|
|||
V_VT(&ret) = VT_EMPTY;
|
||||
hr_disp = IDispatch_Invoke(disp, DISPID_PICT_RENDER, &GUID_NULL, 0, DISPATCH_METHOD,
|
||||
¶ms, &ret, NULL, NULL);
|
||||
ok(hr == hr_disp, "DISPID_PICT_RENDER returned wrong code, 0x%08x, expected 0x%08x\n",
|
||||
ok(hr == hr_disp, "DISPID_PICT_RENDER returned wrong code, 0x%08lx, expected 0x%08lx\n",
|
||||
hr_disp, hr);
|
||||
|
||||
IDispatch_Release(disp);
|
||||
|
@ -804,9 +804,9 @@ static void test_Render(void)
|
|||
|
||||
/* test IPicture::Render return code on uninitialized picture */
|
||||
hres = OleCreatePictureIndirect(NULL, &IID_IPicture, TRUE, (void **)&pic);
|
||||
ok(hres == S_OK, "Failed to create a picture, hr %#x.\n", hres);
|
||||
ok(hres == S_OK, "Failed to create a picture, hr %#lx.\n", hres);
|
||||
hres = IPicture_get_Type(pic, &type);
|
||||
ok(hres == S_OK, "IPicture_get_Type does not return S_OK, but 0x%08x\n", hres);
|
||||
ok(hres == S_OK, "IPicture_get_Type does not return S_OK, but 0x%08lx\n", hres);
|
||||
ok(type == PICTYPE_UNINITIALIZED, "Expected type = PICTYPE_UNINITIALIZED, got = %d\n", type);
|
||||
/* zero dimensions */
|
||||
hres = picture_render(pic, hdc, 0, 0, 0, 0, 0, 0, 0, 0, NULL);
|
||||
|
@ -838,7 +838,7 @@ static void test_Render(void)
|
|||
}
|
||||
|
||||
hres = OleCreatePictureIndirect(&desc, &IID_IPicture, TRUE, (void **)&pic);
|
||||
ok(hres == S_OK, "Failed to create a picture, hr %#x.\n", hres);
|
||||
ok(hres == S_OK, "Failed to create a picture, hr %#lx.\n", hres);
|
||||
/* zero dimensions, PICTYPE_ICON */
|
||||
hres = picture_render(pic, hdc, 0, 0, 0, 0, 0, 0, 0, 0, NULL);
|
||||
ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE);
|
||||
|
@ -872,13 +872,13 @@ static void test_Render(void)
|
|||
/* Evaluate the rendered Icon */
|
||||
result = GetPixel(hdc, 0, 0);
|
||||
ok(result == expected,
|
||||
"Color at 0,0 should be unchanged 0x%06X, but was 0x%06X\n", expected, result);
|
||||
"Color at 0,0 should be unchanged 0x%06lX, but was 0x%06lX\n", expected, result);
|
||||
result = GetPixel(hdc, 5, 5);
|
||||
ok(result != expected,
|
||||
"Color at 5,5 should have changed, but still was 0x%06X\n", expected);
|
||||
"Color at 5,5 should have changed, but still was 0x%06lX\n", expected);
|
||||
result = GetPixel(hdc, 10, 10);
|
||||
ok(result == expected,
|
||||
"Color at 10,10 should be unchanged 0x%06X, but was 0x%06X\n", expected, result);
|
||||
"Color at 10,10 should be unchanged 0x%06lX, but was 0x%06lX\n", expected, result);
|
||||
|
||||
done:
|
||||
IPicture_Release(pic);
|
||||
|
@ -893,9 +893,9 @@ static void test_get_Attributes(void)
|
|||
DWORD attr;
|
||||
|
||||
hres = OleCreatePictureIndirect(NULL, &IID_IPicture, TRUE, (void **)&pic);
|
||||
ok(hres == S_OK, "Failed to create a picture, hr %#x.\n", hres);
|
||||
ok(hres == S_OK, "Failed to create a picture, hr %#lx.\n", hres);
|
||||
hres = IPicture_get_Type(pic, &type);
|
||||
ok(hres == S_OK, "IPicture_get_Type does not return S_OK, but 0x%08x\n", hres);
|
||||
ok(hres == S_OK, "IPicture_get_Type does not return S_OK, but 0x%08lx\n", hres);
|
||||
ok(type == PICTYPE_UNINITIALIZED, "Expected type = PICTYPE_UNINITIALIZED, got = %d\n", type);
|
||||
|
||||
hres = IPicture_get_Attributes(pic, NULL);
|
||||
|
@ -904,7 +904,7 @@ static void test_get_Attributes(void)
|
|||
attr = 0xdeadbeef;
|
||||
hres = IPicture_get_Attributes(pic, &attr);
|
||||
ole_expect(hres, S_OK);
|
||||
ok(attr == 0, "IPicture_get_Attributes does not reset attr to zero, got %d\n", attr);
|
||||
ok(attr == 0, "IPicture_get_Attributes does not reset attr to zero, got %ld\n", attr);
|
||||
|
||||
IPicture_Release(pic);
|
||||
}
|
||||
|
@ -915,7 +915,7 @@ static void test_get_Handle(void)
|
|||
HRESULT hres;
|
||||
|
||||
hres = OleCreatePictureIndirect(NULL, &IID_IPicture, TRUE, (void **)&pic);
|
||||
ok(hres == S_OK, "Failed to create a picture, hr %#x.\n", hres);
|
||||
ok(hres == S_OK, "Failed to create a picture, hr %#lx.\n", hres);
|
||||
hres = IPicture_get_Handle(pic, NULL);
|
||||
ole_expect(hres, E_POINTER);
|
||||
|
||||
|
@ -928,7 +928,7 @@ static void test_get_Type(void)
|
|||
HRESULT hres;
|
||||
|
||||
hres = OleCreatePictureIndirect(NULL, &IID_IPicture, TRUE, (void **)&pic);
|
||||
ok(hres == S_OK, "Failed to create a picture, hr %#x.\n", hres);
|
||||
ok(hres == S_OK, "Failed to create a picture, hr %#lx.\n", hres);
|
||||
|
||||
hres = IPicture_get_Type(pic, NULL);
|
||||
ole_expect(hres, E_POINTER);
|
||||
|
@ -972,7 +972,7 @@ static void test_OleLoadPicturePath(void)
|
|||
invalid_parameters[i].riid,
|
||||
(void **)invalid_parameters[i].pic);
|
||||
ok(hres == E_INVALIDARG,
|
||||
"[%d] Expected OleLoadPicturePath to return E_INVALIDARG, got 0x%08x\n", i, hres);
|
||||
"[%d] Expected OleLoadPicturePath to return E_INVALIDARG, got 0x%08lx\n", i, hres);
|
||||
ok(pic == (IPicture *)0xdeadbeef,
|
||||
"[%d] Expected output pointer to be 0xdeadbeef, got %p\n", i, pic);
|
||||
}
|
||||
|
@ -983,7 +983,7 @@ static void test_OleLoadPicturePath(void)
|
|||
ok(hres == INET_E_UNKNOWN_PROTOCOL || /* XP/Vista+ */
|
||||
broken(hres == E_UNEXPECTED) || /* NT4 */
|
||||
broken(hres == E_OUTOFMEMORY), /* Win2k/Win2k3 */
|
||||
"Expected OleLoadPicturePath to return INET_E_UNKNOWN_PROTOCOL, got 0x%08x\n", hres);
|
||||
"Expected OleLoadPicturePath to return INET_E_UNKNOWN_PROTOCOL, got 0x%08lx\n", hres);
|
||||
ok(pic == NULL,
|
||||
"Expected the output interface pointer to be NULL, got %p\n", pic);
|
||||
|
||||
|
@ -993,7 +993,7 @@ static void test_OleLoadPicturePath(void)
|
|||
ok(hres == INET_E_UNKNOWN_PROTOCOL || /* XP/Vista+ */
|
||||
broken(hres == E_UNEXPECTED) || /* NT4 */
|
||||
broken(hres == E_OUTOFMEMORY), /* Win2k/Win2k3 */
|
||||
"Expected OleLoadPicturePath to return INET_E_UNKNOWN_PROTOCOL, got 0x%08x\n", hres);
|
||||
"Expected OleLoadPicturePath to return INET_E_UNKNOWN_PROTOCOL, got 0x%08lx\n", hres);
|
||||
ok(pic == NULL,
|
||||
"Expected the output interface pointer to be NULL, got %p\n", pic);
|
||||
|
||||
|
@ -1011,7 +1011,7 @@ static void test_OleLoadPicturePath(void)
|
|||
hres = OleLoadPicturePath(temp_fileW + 8, NULL, 0, 0, &IID_IPicture, (void **)&pic);
|
||||
ok(hres == S_OK ||
|
||||
broken(hres == E_UNEXPECTED), /* NT4 */
|
||||
"Expected OleLoadPicturePath to return S_OK, got 0x%08x\n", hres);
|
||||
"Expected OleLoadPicturePath to return S_OK, got 0x%08lx\n", hres);
|
||||
if (pic)
|
||||
IPicture_Release(pic);
|
||||
|
||||
|
@ -1019,7 +1019,7 @@ static void test_OleLoadPicturePath(void)
|
|||
hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic);
|
||||
ok(hres == S_OK ||
|
||||
broken(hres == E_UNEXPECTED), /* NT4 */
|
||||
"Expected OleLoadPicturePath to return S_OK, got 0x%08x\n", hres);
|
||||
"Expected OleLoadPicturePath to return S_OK, got 0x%08lx\n", hres);
|
||||
if (pic)
|
||||
IPicture_Release(pic);
|
||||
|
||||
|
@ -1030,13 +1030,13 @@ static void test_OleLoadPicturePath(void)
|
|||
ok(hres == INET_E_RESOURCE_NOT_FOUND || /* XP+ */
|
||||
broken(hres == E_UNEXPECTED) || /* NT4 */
|
||||
broken(hres == E_FAIL), /*Win2k */
|
||||
"Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08x\n", hres);
|
||||
"Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08lx\n", hres);
|
||||
|
||||
hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic);
|
||||
ok(hres == INET_E_RESOURCE_NOT_FOUND || /* XP+ */
|
||||
broken(hres == E_UNEXPECTED) || /* NT4 */
|
||||
broken(hres == E_FAIL), /* Win2k */
|
||||
"Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08x\n", hres);
|
||||
"Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08lx\n", hres);
|
||||
|
||||
file = CreateFileA(temp_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
@ -1055,7 +1055,7 @@ static void test_OleLoadPicturePath(void)
|
|||
hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic);
|
||||
ok(hres == S_OK ||
|
||||
broken(hres == E_UNEXPECTED), /* NT4 */
|
||||
"Expected OleLoadPicturePath to return S_OK, got 0x%08x\n", hres);
|
||||
"Expected OleLoadPicturePath to return S_OK, got 0x%08lx\n", hres);
|
||||
if (pic)
|
||||
IPicture_Release(pic);
|
||||
|
||||
|
@ -1066,7 +1066,7 @@ static void test_OleLoadPicturePath(void)
|
|||
ok(hres == INET_E_RESOURCE_NOT_FOUND || /* XP+ */
|
||||
broken(hres == E_UNEXPECTED) || /* NT4 */
|
||||
broken(hres == E_FAIL), /* Win2k */
|
||||
"Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08x\n", hres);
|
||||
"Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08lx\n", hres);
|
||||
}
|
||||
|
||||
static void test_himetric(void)
|
||||
|
@ -1095,19 +1095,19 @@ static void test_himetric(void)
|
|||
|
||||
/* size in himetric units reported rounded up to next integer value */
|
||||
hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
cx = 0;
|
||||
d = MulDiv((INT)(1.9 * GetDeviceCaps(hdc, LOGPIXELSX)), 2540, GetDeviceCaps(hdc, LOGPIXELSX));
|
||||
hr = IPicture_get_Width(pic, &cx);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(cx == d, "got %d, expected %d\n", cx, d);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(cx == d, "got %ld, expected %d\n", cx, d);
|
||||
|
||||
cy = 0;
|
||||
d = MulDiv((INT)(1.9 * GetDeviceCaps(hdc, LOGPIXELSY)), 2540, GetDeviceCaps(hdc, LOGPIXELSY));
|
||||
hr = IPicture_get_Height(pic, &cy);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(cy == d, "got %d, expected %d\n", cy, d);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(cy == d, "got %ld, expected %d\n", cy, d);
|
||||
|
||||
DeleteObject(bmp);
|
||||
IPicture_Release(pic);
|
||||
|
@ -1121,19 +1121,19 @@ static void test_himetric(void)
|
|||
desc.u.icon.hicon = icon;
|
||||
|
||||
hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
cx = 0;
|
||||
d = MulDiv(GetSystemMetrics(SM_CXICON), 2540, GetDeviceCaps(hdc, LOGPIXELSX));
|
||||
hr = IPicture_get_Width(pic, &cx);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(cx == d, "got %d, expected %d\n", cx, d);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(cx == d, "got %ld, expected %d\n", cx, d);
|
||||
|
||||
cy = 0;
|
||||
d = MulDiv(GetSystemMetrics(SM_CYICON), 2540, GetDeviceCaps(hdc, LOGPIXELSY));
|
||||
hr = IPicture_get_Height(pic, &cy);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(cy == d, "got %d, expected %d\n", cy, d);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(cy == d, "got %ld, expected %d\n", cy, d);
|
||||
|
||||
IPicture_Release(pic);
|
||||
DestroyIcon(icon);
|
||||
|
@ -1160,55 +1160,55 @@ static void test_load_save_bmp(void)
|
|||
desc.u.bmp.hpal = 0;
|
||||
desc.u.bmp.hbitmap = CreateBitmap(1, 1, 1, 1, NULL);
|
||||
hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic);
|
||||
ok(hr == S_OK, "OleCreatePictureIndirect error %#x\n", hr);
|
||||
ok(hr == S_OK, "OleCreatePictureIndirect error %#lx\n", hr);
|
||||
|
||||
type = -1;
|
||||
hr = IPicture_get_Type(pic, &type);
|
||||
ok(hr == S_OK,"get_Type error %#8x\n", hr);
|
||||
ok(hr == S_OK,"get_Type error %#8lx\n", hr);
|
||||
ok(type == PICTYPE_BITMAP,"expected picture type PICTYPE_BITMAP, got %d\n", type);
|
||||
|
||||
hr = IPicture_get_Handle(pic, &handle);
|
||||
ok(hr == S_OK,"get_Handle error %#8x\n", hr);
|
||||
ok(hr == S_OK,"get_Handle error %#8lx\n", hr);
|
||||
ok(IntToPtr(handle) == desc.u.bmp.hbitmap, "get_Handle returned wrong handle %#x\n", handle);
|
||||
|
||||
hmem = GlobalAlloc(GMEM_ZEROINIT, 4096);
|
||||
hr = CreateStreamOnHGlobal(hmem, FALSE, &dst_stream);
|
||||
ok(hr == S_OK, "createstreamonhglobal error %#x\n", hr);
|
||||
ok(hr == S_OK, "createstreamonhglobal error %#lx\n", hr);
|
||||
|
||||
size = -1;
|
||||
hr = IPicture_SaveAsFile(pic, dst_stream, TRUE, &size);
|
||||
ok(hr == S_OK, "IPicture_SaveasFile error %#x\n", hr);
|
||||
ok(hr == S_OK, "IPicture_SaveasFile error %#lx\n", hr);
|
||||
todo_wine
|
||||
ok(size == 66, "expected 66, got %d\n", size);
|
||||
ok(size == 66, "expected 66, got %ld\n", size);
|
||||
mem = GlobalLock(hmem);
|
||||
todo_wine
|
||||
ok(!memcmp(&mem[0], "BM", 2), "got wrong bmp header %04x\n", mem[0]);
|
||||
ok(!memcmp(&mem[0], "BM", 2), "got wrong bmp header %04lx\n", mem[0]);
|
||||
GlobalUnlock(hmem);
|
||||
|
||||
size = -1;
|
||||
hr = IPicture_SaveAsFile(pic, dst_stream, FALSE, &size);
|
||||
todo_wine
|
||||
ok(hr == E_FAIL, "expected E_FAIL, got %#x\n", hr);
|
||||
ok(hr == E_FAIL, "expected E_FAIL, got %#lx\n", hr);
|
||||
todo_wine
|
||||
ok(size == -1, "expected -1, got %d\n", size);
|
||||
ok(size == -1, "expected -1, got %ld\n", size);
|
||||
|
||||
offset.QuadPart = 0;
|
||||
hr = IStream_Seek(dst_stream, offset, SEEK_SET, NULL);
|
||||
ok(hr == S_OK, "IStream_Seek %#x\n", hr);
|
||||
ok(hr == S_OK, "IStream_Seek %#lx\n", hr);
|
||||
|
||||
hr = IPicture_QueryInterface(pic, &IID_IPersistStream, (void **)&src_stream);
|
||||
ok(hr == S_OK, "QueryInterface error %#x\n", hr);
|
||||
ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
|
||||
|
||||
hr = IPersistStream_Save(src_stream, dst_stream, TRUE);
|
||||
ok(hr == S_OK, "Save error %#x\n", hr);
|
||||
ok(hr == S_OK, "Save error %#lx\n", hr);
|
||||
|
||||
IPersistStream_Release(src_stream);
|
||||
IStream_Release(dst_stream);
|
||||
|
||||
mem = GlobalLock(hmem);
|
||||
ok(!memcmp(mem, "lt\0\0", 4), "got wrong stream header %04x\n", mem[0]);
|
||||
ok(mem[1] == 66, "expected stream size 66, got %u\n", mem[1]);
|
||||
ok(!memcmp(&mem[2], "BM", 2), "got wrong bmp header %04x\n", mem[2]);
|
||||
ok(!memcmp(mem, "lt\0\0", 4), "got wrong stream header %04lx\n", mem[0]);
|
||||
ok(mem[1] == 66, "expected stream size 66, got %lu\n", mem[1]);
|
||||
ok(!memcmp(&mem[2], "BM", 2), "got wrong bmp header %04lx\n", mem[2]);
|
||||
|
||||
GlobalUnlock(hmem);
|
||||
GlobalFree(hmem);
|
||||
|
@ -1235,56 +1235,56 @@ static void test_load_save_icon(void)
|
|||
desc.picType = PICTYPE_ICON;
|
||||
desc.u.icon.hicon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION);
|
||||
hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic);
|
||||
ok(hr == S_OK, "OleCreatePictureIndirect error %#x\n", hr);
|
||||
ok(hr == S_OK, "OleCreatePictureIndirect error %#lx\n", hr);
|
||||
|
||||
type = -1;
|
||||
hr = IPicture_get_Type(pic, &type);
|
||||
ok(hr == S_OK,"get_Type error %#8x\n", hr);
|
||||
ok(hr == S_OK,"get_Type error %#8lx\n", hr);
|
||||
ok(type == PICTYPE_ICON,"expected picture type PICTYPE_ICON, got %d\n", type);
|
||||
|
||||
hr = IPicture_get_Handle(pic, &handle);
|
||||
ok(hr == S_OK,"get_Handle error %#8x\n", hr);
|
||||
ok(hr == S_OK,"get_Handle error %#8lx\n", hr);
|
||||
ok(IntToPtr(handle) == desc.u.icon.hicon, "get_Handle returned wrong handle %#x\n", handle);
|
||||
|
||||
hmem = GlobalAlloc(GMEM_ZEROINIT, 8192);
|
||||
hr = CreateStreamOnHGlobal(hmem, FALSE, &dst_stream);
|
||||
ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr);
|
||||
ok(hr == S_OK, "CreateStreamOnHGlobal error %#lx\n", hr);
|
||||
|
||||
size = -1;
|
||||
hr = IPicture_SaveAsFile(pic, dst_stream, TRUE, &size);
|
||||
ok(hr == S_OK, "IPicture_SaveasFile error %#x\n", hr);
|
||||
ok(hr == S_OK, "IPicture_SaveasFile error %#lx\n", hr);
|
||||
todo_wine
|
||||
ok(size == 766, "expected 766, got %d\n", size);
|
||||
ok(size == 766, "expected 766, got %ld\n", size);
|
||||
mem = GlobalLock(hmem);
|
||||
todo_wine
|
||||
ok(mem[0] == 0x00010000, "got wrong icon header %04x\n", mem[0]);
|
||||
ok(mem[0] == 0x00010000, "got wrong icon header %04lx\n", mem[0]);
|
||||
GlobalUnlock(hmem);
|
||||
|
||||
size = -1;
|
||||
hr = IPicture_SaveAsFile(pic, dst_stream, FALSE, &size);
|
||||
todo_wine
|
||||
ok(hr == E_FAIL, "expected E_FAIL, got %#x\n", hr);
|
||||
ok(hr == E_FAIL, "expected E_FAIL, got %#lx\n", hr);
|
||||
todo_wine
|
||||
ok(size == -1, "expected -1, got %d\n", size);
|
||||
ok(size == -1, "expected -1, got %ld\n", size);
|
||||
|
||||
offset.QuadPart = 0;
|
||||
hr = IStream_Seek(dst_stream, offset, SEEK_SET, NULL);
|
||||
ok(hr == S_OK, "IStream_Seek %#x\n", hr);
|
||||
ok(hr == S_OK, "IStream_Seek %#lx\n", hr);
|
||||
|
||||
hr = IPicture_QueryInterface(pic, &IID_IPersistStream, (void **)&src_stream);
|
||||
ok(hr == S_OK, "QueryInterface error %#x\n", hr);
|
||||
ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
|
||||
|
||||
hr = IPersistStream_Save(src_stream, dst_stream, TRUE);
|
||||
ok(hr == S_OK, "Saveerror %#x\n", hr);
|
||||
ok(hr == S_OK, "Saveerror %#lx\n", hr);
|
||||
|
||||
IPersistStream_Release(src_stream);
|
||||
IStream_Release(dst_stream);
|
||||
|
||||
mem = GlobalLock(hmem);
|
||||
ok(!memcmp(mem, "lt\0\0", 4), "got wrong stream header %04x\n", mem[0]);
|
||||
ok(!memcmp(mem, "lt\0\0", 4), "got wrong stream header %04lx\n", mem[0]);
|
||||
todo_wine
|
||||
ok(mem[1] == 766, "expected stream size 766, got %u\n", mem[1]);
|
||||
ok(mem[2] == 0x00010000, "got wrong icon header %04x\n", mem[2]);
|
||||
ok(mem[1] == 766, "expected stream size 766, got %lu\n", mem[1]);
|
||||
ok(mem[2] == 0x00010000, "got wrong icon header %04lx\n", mem[2]);
|
||||
|
||||
GlobalUnlock(hmem);
|
||||
GlobalFree(hmem);
|
||||
|
@ -1311,43 +1311,43 @@ static void test_load_save_empty_picture(void)
|
|||
desc.cbSizeofstruct = sizeof(desc);
|
||||
desc.picType = PICTYPE_NONE;
|
||||
hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void **)&pic);
|
||||
ok(hr == S_OK, "OleCreatePictureIndirect error %#x\n", hr);
|
||||
ok(hr == S_OK, "OleCreatePictureIndirect error %#lx\n", hr);
|
||||
|
||||
type = -1;
|
||||
hr = IPicture_get_Type(pic, &type);
|
||||
ok(hr == S_OK, "get_Type error %#x\n", hr);
|
||||
ok(hr == S_OK, "get_Type error %#lx\n", hr);
|
||||
ok(type == PICTYPE_NONE,"expected picture type PICTYPE_NONE, got %d\n", type);
|
||||
|
||||
handle = (OLE_HANDLE)0xdeadbeef;
|
||||
hr = IPicture_get_Handle(pic, &handle);
|
||||
ok(hr == S_OK,"get_Handle error %#8x\n", hr);
|
||||
ok(hr == S_OK,"get_Handle error %#8lx\n", hr);
|
||||
ok(!handle, "get_Handle returned wrong handle %#x\n", handle);
|
||||
|
||||
hmem = GlobalAlloc(GMEM_ZEROINIT, 4096);
|
||||
hr = CreateStreamOnHGlobal(hmem, FALSE, &dst_stream);
|
||||
ok(hr == S_OK, "createstreamonhglobal error %#x\n", hr);
|
||||
ok(hr == S_OK, "createstreamonhglobal error %#lx\n", hr);
|
||||
|
||||
size = -1;
|
||||
hr = IPicture_SaveAsFile(pic, dst_stream, TRUE, &size);
|
||||
ok(hr == S_OK, "IPicture_SaveasFile error %#x\n", hr);
|
||||
ok(hr == S_OK, "IPicture_SaveasFile error %#lx\n", hr);
|
||||
todo_wine
|
||||
ok(size == -1, "expected -1, got %d\n", size);
|
||||
ok(size == -1, "expected -1, got %ld\n", size);
|
||||
|
||||
size = -1;
|
||||
hr = IPicture_SaveAsFile(pic, dst_stream, FALSE, &size);
|
||||
ok(hr == S_OK, "IPicture_SaveasFile error %#x\n", hr);
|
||||
ok(hr == S_OK, "IPicture_SaveasFile error %#lx\n", hr);
|
||||
todo_wine
|
||||
ok(size == -1, "expected -1, got %d\n", size);
|
||||
ok(size == -1, "expected -1, got %ld\n", size);
|
||||
|
||||
hr = IPicture_QueryInterface(pic, &IID_IPersistStream, (void **)&src_stream);
|
||||
ok(hr == S_OK, "QueryInterface error %#x\n", hr);
|
||||
ok(hr == S_OK, "QueryInterface error %#lx\n", hr);
|
||||
|
||||
hr = IPersistStream_Save(src_stream, dst_stream, TRUE);
|
||||
ok(hr == S_OK, "Save error %#x\n", hr);
|
||||
ok(hr == S_OK, "Save error %#lx\n", hr);
|
||||
|
||||
mem = GlobalLock(hmem);
|
||||
ok(!memcmp(mem, "lt\0\0", 4), "got wrong stream header %04x\n", mem[0]);
|
||||
ok(mem[1] == 0, "expected stream size 0, got %u\n", mem[1]);
|
||||
ok(!memcmp(mem, "lt\0\0", 4), "got wrong stream header %04lx\n", mem[0]);
|
||||
ok(mem[1] == 0, "expected stream size 0, got %lu\n", mem[1]);
|
||||
GlobalUnlock(hmem);
|
||||
|
||||
IPersistStream_Release(src_stream);
|
||||
|
@ -1356,22 +1356,22 @@ static void test_load_save_empty_picture(void)
|
|||
/* first with statable and seekable stream */
|
||||
offset.QuadPart = 0;
|
||||
hr = IStream_Seek(dst_stream, offset, SEEK_SET, NULL);
|
||||
ok(hr == S_OK, "IStream_Seek %#x\n", hr);
|
||||
ok(hr == S_OK, "IStream_Seek %#lx\n", hr);
|
||||
|
||||
pic = NULL;
|
||||
hr = pOleLoadPicture(dst_stream, 0, FALSE, &IID_IPicture, (void **)&pic);
|
||||
ok(hr == S_OK, "OleLoadPicture error %#x\n", hr);
|
||||
ok(hr == S_OK, "OleLoadPicture error %#lx\n", hr);
|
||||
ok(pic != NULL,"picture should not be not NULL\n");
|
||||
if (pic != NULL)
|
||||
{
|
||||
type = -1;
|
||||
hr = IPicture_get_Type(pic, &type);
|
||||
ok(hr == S_OK,"get_Type error %#8x\n", hr);
|
||||
ok(hr == S_OK,"get_Type error %#8lx\n", hr);
|
||||
ok(type == PICTYPE_NONE,"expected picture type PICTYPE_NONE, got %d\n", type);
|
||||
|
||||
handle = (OLE_HANDLE)0xdeadbeef;
|
||||
hr = IPicture_get_Handle(pic, &handle);
|
||||
ok(hr == S_OK,"get_Handle error %#8x\n", hr);
|
||||
ok(hr == S_OK,"get_Handle error %#8lx\n", hr);
|
||||
ok(!handle, "get_Handle returned wrong handle %#x\n", handle);
|
||||
|
||||
IPicture_Release(pic);
|
||||
|
@ -1384,18 +1384,18 @@ static void test_load_save_empty_picture(void)
|
|||
|
||||
pic = NULL;
|
||||
hr = pOleLoadPicture(stream, 0, FALSE, &IID_IPicture, (void **)&pic);
|
||||
ok(hr == S_OK, "OleLoadPicture error %#x\n", hr);
|
||||
ok(hr == S_OK, "OleLoadPicture error %#lx\n", hr);
|
||||
ok(pic != NULL,"picture should not be not NULL\n");
|
||||
if (pic != NULL)
|
||||
{
|
||||
type = -1;
|
||||
hr = IPicture_get_Type(pic, &type);
|
||||
ok(hr == S_OK,"get_Type error %#8x\n", hr);
|
||||
ok(hr == S_OK,"get_Type error %#8lx\n", hr);
|
||||
ok(type == PICTYPE_NONE,"expected picture type PICTYPE_NONE, got %d\n", type);
|
||||
|
||||
handle = (OLE_HANDLE)0xdeadbeef;
|
||||
hr = IPicture_get_Handle(pic, &handle);
|
||||
ok(hr == S_OK,"get_Handle error %#8x\n", hr);
|
||||
ok(hr == S_OK,"get_Handle error %#8lx\n", hr);
|
||||
ok(!handle, "get_Handle returned wrong handle %#x\n", handle);
|
||||
|
||||
IPicture_Release(pic);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -40,7 +40,7 @@
|
|||
#define FMT_NUMBER(vt,val) \
|
||||
VariantInit(&v); V_VT(&v) = vt; val(&v) = 1; \
|
||||
hres = VarFormatNumber(&v,2,0,0,0,0,&str); \
|
||||
ok(hres == S_OK, "VarFormatNumber (vt %d): returned %8x\n", vt, hres); \
|
||||
ok(hres == S_OK, "VarFormatNumber (vt %d): returned %8lx\n", vt, hres); \
|
||||
if (hres == S_OK) { \
|
||||
ok(str && wcscmp(str,szResult1) == 0, \
|
||||
"VarFormatNumber (vt %d): string different\n", vt); \
|
||||
|
@ -78,7 +78,7 @@ static void test_VarFormatNumber(void)
|
|||
V_BSTR(&v) = SysAllocString(L"1");
|
||||
|
||||
hres = VarFormatNumber(&v,2,0,0,0,0,&str);
|
||||
ok(hres == S_OK, "VarFormatNumber (bstr): returned %8x\n", hres);
|
||||
ok(hres == S_OK, "VarFormatNumber (bstr): returned %8lx\n", hres);
|
||||
if (hres == S_OK)
|
||||
ok(str && wcscmp(str, szResult1) == 0, "VarFormatNumber (bstr): string different\n");
|
||||
SysFreeString(V_BSTR(&v));
|
||||
|
@ -86,7 +86,7 @@ static void test_VarFormatNumber(void)
|
|||
|
||||
V_BSTR(&v) = SysAllocString(L"-1");
|
||||
hres = VarFormatNumber(&v,2,0,-1,0,0,&str);
|
||||
ok(hres == S_OK, "VarFormatNumber (bstr): returned %8x\n", hres);
|
||||
ok(hres == S_OK, "VarFormatNumber (bstr): returned %8lx\n", hres);
|
||||
if (hres == S_OK)
|
||||
ok(str && wcscmp(str, L"(1.00)") == 0, "VarFormatNumber (-bstr): string different\n");
|
||||
SysFreeString(V_BSTR(&v));
|
||||
|
@ -384,21 +384,21 @@ static void test_VarFormat(void)
|
|||
/* 'out' is not cleared */
|
||||
out = (BSTR)0x1;
|
||||
hres = VarFormat(&in,NULL,fd,fw,flags,&out); /* Would crash if out is cleared */
|
||||
ok(hres == S_OK, "got %08x\n", hres);
|
||||
ok(hres == S_OK, "got %08lx\n", hres);
|
||||
SysFreeString(out);
|
||||
out = NULL;
|
||||
|
||||
/* VT_NULL */
|
||||
V_VT(&in) = VT_NULL;
|
||||
hres = VarFormat(&in,NULL,fd,fw,0,&out);
|
||||
ok(hres == S_OK, "VarFormat failed with 0x%08x\n", hres);
|
||||
ok(hres == S_OK, "VarFormat failed with 0x%08lx\n", hres);
|
||||
ok(out == NULL, "expected NULL formatted string\n");
|
||||
|
||||
/* Invalid args */
|
||||
hres = VarFormat(&in,NULL,fd,fw,flags,NULL);
|
||||
ok(hres == E_INVALIDARG, "Null out: expected E_INVALIDARG, got 0x%08x\n", hres);
|
||||
ok(hres == E_INVALIDARG, "Null out: expected E_INVALIDARG, got 0x%08lx\n", hres);
|
||||
hres = VarFormat(NULL,NULL,fd,fw,flags,&out);
|
||||
ok(hres == E_INVALIDARG, "Null in: expected E_INVALIDARG, got 0x%08x\n", hres);
|
||||
ok(hres == E_INVALIDARG, "Null in: expected E_INVALIDARG, got 0x%08lx\n", hres);
|
||||
fd = -1;
|
||||
VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"",E_INVALIDARG,"");
|
||||
fd = 8;
|
||||
|
@ -480,7 +480,7 @@ static void test_VarWeekdayName(void)
|
|||
|
||||
hres = VarWeekdayName(1, 0, 0, 0, NULL);
|
||||
ok(E_INVALIDARG == hres,
|
||||
"Null pointer: expected E_INVALIDARG, got 0x%08x\n", hres);
|
||||
"Null pointer: expected E_INVALIDARG, got 0x%08lx\n", hres);
|
||||
|
||||
/* Check all combinations */
|
||||
for (iWeekday = 1; iWeekday <= 7; ++iWeekday)
|
||||
|
@ -532,17 +532,17 @@ static void test_VarFormatFromTokens(void)
|
|||
|
||||
lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
|
||||
hres = VarTokenizeFormatString(number_fmt, buff, sizeof(buff), 1, 1, lcid, NULL);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %lx\n", hres);
|
||||
hres = VarFormatFromTokens(&var, number_fmt, buff, 0, &bstr, lcid);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %lx\n", hres);
|
||||
ok(!wcscmp(bstr, L"690.00"), "incorrectly formatted number: %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
lcid = MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
|
||||
hres = VarTokenizeFormatString(number_fmt, buff, sizeof(buff), 1, 1, lcid, NULL);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %lx\n", hres);
|
||||
hres = VarFormatFromTokens(&var, number_fmt, buff, 0, &bstr, lcid);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %lx\n", hres);
|
||||
ok(!wcscmp(bstr, L"6,90"), "incorrectly formatted number: %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
|
@ -553,17 +553,17 @@ static void test_VarFormatFromTokens(void)
|
|||
|
||||
lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
|
||||
hres = VarTokenizeFormatString(date_fmt, buff, sizeof(buff), 1, 1, lcid, NULL);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %lx\n", hres);
|
||||
hres = VarFormatFromTokens(&var, date_fmt, buff, 0, &bstr, lcid);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %lx\n", hres);
|
||||
ok(!wcscmp(bstr, L"11-12"), "incorrectly formatted date: %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
lcid = MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
|
||||
hres = VarTokenizeFormatString(date_fmt, buff, sizeof(buff), 1, 1, lcid, NULL);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %lx\n", hres);
|
||||
hres = VarFormatFromTokens(&var, date_fmt, buff, 0, &bstr, lcid);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %lx\n", hres);
|
||||
ok(!wcscmp(bstr, L"12-11"), "incorrectly formatted date: %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
|
@ -574,17 +574,17 @@ static void test_VarFormatFromTokens(void)
|
|||
|
||||
lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
|
||||
hres = VarTokenizeFormatString(string_fmt, buff, sizeof(buff), 1, 1, lcid, NULL);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %lx\n", hres);
|
||||
hres = VarFormatFromTokens(&var, string_fmt, buff, 0, &bstr, lcid);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %lx\n", hres);
|
||||
ok(!wcscmp(bstr, L"1.5"), "incorrectly formatted string: %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
lcid = MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
|
||||
hres = VarTokenizeFormatString(string_fmt, buff, sizeof(buff), 1, 1, lcid, NULL);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarTokenizeFormatString failed: %lx\n", hres);
|
||||
hres = VarFormatFromTokens(&var, string_fmt, buff, 0, &bstr, lcid);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %x\n", hres);
|
||||
ok(hres == S_OK, "VarFormatFromTokens failed: %lx\n", hres);
|
||||
ok(!wcscmp(bstr, L"1,5"), "incorrectly formatted string: %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
}
|
||||
|
@ -596,32 +596,32 @@ static void test_GetAltMonthNames(void)
|
|||
|
||||
str = (void *)0xdeadbeef;
|
||||
hr = GetAltMonthNames(0, &str);
|
||||
ok(hr == S_OK, "Unexpected return value %08x\n", hr);
|
||||
ok(hr == S_OK, "Unexpected return value %08lx\n", hr);
|
||||
ok(str == NULL, "Got %p\n", str);
|
||||
|
||||
str = (void *)0xdeadbeef;
|
||||
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT), &str);
|
||||
ok(hr == S_OK, "Unexpected return value %08x\n", hr);
|
||||
ok(hr == S_OK, "Unexpected return value %08lx\n", hr);
|
||||
ok(str == NULL, "Got %p\n", str);
|
||||
|
||||
str = NULL;
|
||||
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_ARABIC, SUBLANG_ARABIC_EGYPT), SORT_DEFAULT), &str);
|
||||
ok(hr == S_OK, "Unexpected return value %08x\n", hr);
|
||||
ok(hr == S_OK, "Unexpected return value %08lx\n", hr);
|
||||
ok(str != NULL, "Got %p\n", str);
|
||||
|
||||
str2 = NULL;
|
||||
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_ARABIC, SUBLANG_ARABIC_EGYPT), SORT_DEFAULT), &str2);
|
||||
ok(hr == S_OK, "Unexpected return value %08x\n", hr);
|
||||
ok(hr == S_OK, "Unexpected return value %08lx\n", hr);
|
||||
ok(str2 == str, "Got %p\n", str2);
|
||||
|
||||
str = NULL;
|
||||
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT), SORT_DEFAULT), &str);
|
||||
ok(hr == S_OK, "Unexpected return value %08x\n", hr);
|
||||
ok(hr == S_OK, "Unexpected return value %08lx\n", hr);
|
||||
ok(str != NULL, "Got %p\n", str);
|
||||
|
||||
str = NULL;
|
||||
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_POLISH, SUBLANG_DEFAULT), SORT_DEFAULT), &str);
|
||||
ok(hr == S_OK, "Unexpected return value %08x\n", hr);
|
||||
ok(hr == S_OK, "Unexpected return value %08lx\n", hr);
|
||||
ok(str != NULL, "Got %p\n", str);
|
||||
}
|
||||
|
||||
|
@ -634,19 +634,19 @@ static void test_VarFormatCurrency(void)
|
|||
V_CY(&in).int64 = 0;
|
||||
V_VT(&in) = VT_CY;
|
||||
hr = VarFormatCurrency(&in, 3, -2, -2, -2, 0, &str);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
V_VT(&in) = VT_BSTR;
|
||||
V_BSTR(&in) = str;
|
||||
hr = VarFormatCurrency(&in, 1, -2, -2, -2, 0, &str2);
|
||||
ok(hr == S_OK, "Unexpected hr %#x for %s\n", hr, wine_dbgstr_w(str));
|
||||
ok(hr == S_OK, "Unexpected hr %#lx for %s\n", hr, wine_dbgstr_w(str));
|
||||
ok(lstrcmpW(str, str2), "Expected different string.\n");
|
||||
SysFreeString(str2);
|
||||
|
||||
V_VT(&in) = VT_BSTR | VT_BYREF;
|
||||
V_BSTRREF(&in) = &str;
|
||||
hr = VarFormatCurrency(&in, 1, -2, -2, -2, 0, &str2);
|
||||
ok(hr == S_OK, "Unexpected hr %#x for %s\n", hr, wine_dbgstr_w(str));
|
||||
ok(hr == S_OK, "Unexpected hr %#lx for %s\n", hr, wine_dbgstr_w(str));
|
||||
ok(lstrcmpW(str, str2), "Expected different string.\n");
|
||||
|
||||
SysFreeString(str);
|
||||
|
@ -655,7 +655,7 @@ static void test_VarFormatCurrency(void)
|
|||
V_VT(&in) = VT_BSTR;
|
||||
V_BSTR(&in) = SysAllocString(L"test");
|
||||
hr = VarFormatCurrency(&in, 1, -2, -2, -2, 0, &str2);
|
||||
ok(hr == DISP_E_TYPEMISMATCH, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == DISP_E_TYPEMISMATCH, "Unexpected hr %#lx.\n", hr);
|
||||
VariantClear(&in);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -69,7 +69,7 @@ static BOOL has_locales;
|
|||
/* Macros for converting and testing results */
|
||||
#define CONVVARS(typ) HRESULT hres; CONV_TYPE out; typ in
|
||||
|
||||
#define _EXPECT_NO_OUT(res) ok(hres == res, "expected " #res ", got hres=0x%08x\n", hres)
|
||||
#define _EXPECT_NO_OUT(res) ok(hres == res, "expected " #res ", got hres=%#08lx\n", hres)
|
||||
#define EXPECT_OVERFLOW _EXPECT_NO_OUT(DISP_E_OVERFLOW)
|
||||
#define EXPECT_MISMATCH _EXPECT_NO_OUT(DISP_E_TYPEMISMATCH)
|
||||
#define EXPECT_BADVAR _EXPECT_NO_OUT(DISP_E_BADVARTYPE)
|
||||
|
@ -79,12 +79,12 @@ static BOOL has_locales;
|
|||
#define EXPECT_EQ _EXPECT_NO_OUT(VARCMP_EQ)
|
||||
|
||||
#define _EXPECTRES(res, x, fs) \
|
||||
ok(hres == S_OK && out == (CONV_TYPE)(x), "expected " #x ", got " fs "; hres=0x%08x\n", out, hres)
|
||||
ok(hres == S_OK && out == (CONV_TYPE)(x), "expected " #x ", got " fs "; hres=%#08lx\n", out, hres)
|
||||
#define EXPECT(x) EXPECTRES(S_OK, (x))
|
||||
#define EXPECT_DBL(x) \
|
||||
ok(hres == S_OK && EQ_DOUBLE(out, (x)), "expected %.16g, got %.16g; hres=0x%08x\n", (x), out, hres)
|
||||
ok(hres == S_OK && EQ_DOUBLE(out, (x)), "expected %.16g, got %.16g; hres=%#08lx\n", (x), out, hres)
|
||||
#define EXPECT_DBL2(new,old) \
|
||||
ok(hres == S_OK && (EQ_DOUBLE(out, (new)) || broken(EQ_DOUBLE(out, (old)))), "expected %.16g or %.16g, got %.16g; hres=0x%08x\n", (new), (old), out, hres)
|
||||
ok(hres == S_OK && (EQ_DOUBLE(out, (new)) || broken(EQ_DOUBLE(out, (old)))), "expected %.16g or %.16g, got %.16g; hres=%#08lx\n", (new), (old), out, hres)
|
||||
|
||||
#define CONVERT(func, val) in = val; hres = func(in, &out)
|
||||
#define CONVERTRANGE(func,start,end) for (i = start; i < end; i+=1) { CONVERT(func, i); EXPECT(i); };
|
||||
|
@ -128,25 +128,25 @@ static BOOL has_locales;
|
|||
V_VT(&vSrc) = vt; srcval = in; \
|
||||
hres = VariantCopy(&vDst, &vSrc); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == vt && dstval == in, \
|
||||
"copy hres 0x%X, type %d, value (" fs ") " fs "\n", hres, V_VT(&vDst), val, dstval); \
|
||||
"copy hres %#lX, type %d, value (" fs ") " fs "\n", hres, V_VT(&vDst), val, dstval); \
|
||||
V_VT(&vSrc) = vt|VT_BYREF; srcref = ∈ \
|
||||
hres = VariantCopy(&vDst, &vSrc); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == (vt|VT_BYREF) && dstref == &in, \
|
||||
"ref hres 0x%X, type %d, ref (%p) %p\n", hres, V_VT(&vDst), &in, dstref); \
|
||||
"ref hres %#lX, type %d, ref (%p) %p\n", hres, V_VT(&vDst), &in, dstref); \
|
||||
hres = VariantCopyInd(&vDst, &vSrc); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == vt && dstval == in, \
|
||||
"ind hres 0x%X, type %d, value (" fs ") " fs "\n", hres, V_VT(&vDst), val, dstval); \
|
||||
"ind hres %#lX, type %d, value (" fs ") " fs "\n", hres, V_VT(&vDst), val, dstval); \
|
||||
} while(0)
|
||||
|
||||
#define CHANGETYPEEX(typ) hres = VariantChangeTypeEx(&vDst, &vSrc, 0, 0, typ)
|
||||
|
||||
#define TYPETEST(typ,res,fs) CHANGETYPEEX(typ); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == typ && (CONV_TYPE)res == in, \
|
||||
"hres=0x%X, type=%d (should be %d(" #typ ")), value=" fs " (should be " fs ")\n", \
|
||||
"hres=%#lX, type=%d (should be %d(" #typ ")), value=" fs " (should be " fs ")\n", \
|
||||
hres, V_VT(&vDst), typ, (CONV_TYPE)res, in);
|
||||
#define TYPETESTI8(typ,res) CHANGETYPEEX(typ); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == typ && (CONV_TYPE)res == in, \
|
||||
"hres=0x%X, type=%d (should be %d(" #typ ")), value=%d (should be 1)\n", \
|
||||
"hres=%#lX, type=%d (should be %d(" #typ ")), value=%d (should be 1)\n", \
|
||||
hres, V_VT(&vDst), typ, (int)res);
|
||||
#define BADVAR(typ) CHANGETYPEEX(typ); EXPECT_BADVAR
|
||||
#define MISMATCH(typ) CHANGETYPEEX(typ); EXPECT_MISMATCH
|
||||
|
@ -203,31 +203,31 @@ static BOOL has_locales;
|
|||
hres = VariantChangeTypeEx(&vDst, &vSrc, 0, 0, VT_BOOL); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_BOOL && \
|
||||
(V_BOOL(&vDst) == VARIANT_TRUE || (V_VT(&vSrc) == VT_BOOL && V_BOOL(&vDst) == 1)), \
|
||||
"->VT_BOOL hres=0x%X, type=%d (should be VT_BOOL), value %d (should be VARIANT_TRUE)\n", \
|
||||
"->VT_BOOL hres=0x%lX, type=%d (should be VT_BOOL), value %d (should be VARIANT_TRUE)\n", \
|
||||
hres, V_VT(&vDst), V_BOOL(&vDst)); \
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, 0, 0, VT_CY); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_CY && V_CY(&vDst).int64 == CY_MULTIPLIER, \
|
||||
"->VT_CY hres=0x%X, type=%d (should be VT_CY), value (%08x,%08x) (should be CY_MULTIPLIER)\n", \
|
||||
"->VT_CY hres=0x%lX, type=%d (should be VT_CY), value (%08lx,%08lx) (should be CY_MULTIPLIER)\n", \
|
||||
hres, V_VT(&vDst), S(V_CY(&vDst)).Hi, S(V_CY(&vDst)).Lo); \
|
||||
if (V_VT(&vSrc) != VT_DATE) \
|
||||
{ \
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, 0, 0, VT_BSTR); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_BSTR && \
|
||||
V_BSTR(&vDst) && V_BSTR(&vDst)[0] == '1' && V_BSTR(&vDst)[1] == '\0', \
|
||||
"->VT_BSTR hres=0x%X, type=%d (should be VT_BSTR), *bstr='%c'\n", \
|
||||
"->VT_BSTR hres=0x%lX, type=%d (should be VT_BSTR), *bstr='%c'\n", \
|
||||
hres, V_VT(&vDst), V_BSTR(&vDst) ? *V_BSTR(&vDst) : '?'); \
|
||||
} \
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, 0, 0, VT_DECIMAL); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_DECIMAL && \
|
||||
S(U(V_DECIMAL(&vDst))).sign == 0 && S(U(V_DECIMAL(&vDst))).scale == 0 && \
|
||||
V_DECIMAL(&vDst).Hi32 == 0 && U1(V_DECIMAL(&vDst)).Lo64 == (ULONGLONG)in, \
|
||||
"->VT_DECIMAL hres=0x%X, type=%d (should be VT_DECIMAL), sign=%d, scale=%d, hi=%u, lo=(%8x %8x),\n", \
|
||||
"->VT_DECIMAL hres=0x%lX, type=%d (should be VT_DECIMAL), sign=%d, scale=%d, hi=%lu, lo=(%8lx %8lx),\n", \
|
||||
hres, V_VT(&vDst), S(U(V_DECIMAL(&vDst))).sign, S(U(V_DECIMAL(&vDst))).scale, \
|
||||
V_DECIMAL(&vDst).Hi32, S1(U1(V_DECIMAL(&vDst))).Mid32, S1(U1(V_DECIMAL(&vDst))).Lo32); \
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, 0, 0, VT_EMPTY); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_EMPTY, "->VT_EMPTY hres=0x%X, type=%d (should be VT_EMPTY)\n", hres, V_VT(&vDst)); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_EMPTY, "->VT_EMPTY hres=0x%lX, type=%d (should be VT_EMPTY)\n", hres, V_VT(&vDst)); \
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, 0, 0, VT_NULL); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_NULL, "->VT_NULL hres=0x%X, type=%d (should be VT_NULL)\n", hres, V_VT(&vDst)); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_NULL, "->VT_NULL hres=0x%lX, type=%d (should be VT_NULL)\n", hres, V_VT(&vDst)); \
|
||||
MISMATCH(VT_DISPATCH); \
|
||||
MISMATCH(VT_ERROR); \
|
||||
MISMATCH(VT_UNKNOWN); \
|
||||
|
@ -359,7 +359,7 @@ static HRESULT WINAPI DummyDispatch_Invoke(IDispatch *iface,
|
|||
|
||||
CHECK_EXPECT(dispatch_invoke);
|
||||
|
||||
ok(dispid == DISPID_VALUE, "got dispid %d\n", dispid);
|
||||
ok(dispid == DISPID_VALUE, "got dispid %ld\n", dispid);
|
||||
ok(IsEqualIID(riid, &IID_NULL), "go riid %s\n", wine_dbgstr_guid(riid));
|
||||
ok(wFlags == DISPATCH_PROPERTYGET, "Flags wrong\n");
|
||||
|
||||
|
@ -890,7 +890,7 @@ static void test_VarUI1FromDisp(void)
|
|||
SET_EXPECT(dispatch_invoke);
|
||||
out = 10;
|
||||
hres = VarUI1FromDisp(&dispatch.IDispatch_iface, in, &out);
|
||||
ok(broken(hres == DISP_E_BADVARTYPE) || hres == S_OK, "got 0x%08x\n", hres);
|
||||
ok(broken(hres == DISP_E_BADVARTYPE) || hres == S_OK, "got 0x%08lx\n", hres);
|
||||
ok(broken(out == 10) || out == 1, "got %d\n", out);
|
||||
CHECK_CALLED(dispatch_invoke);
|
||||
|
||||
|
@ -898,7 +898,7 @@ static void test_VarUI1FromDisp(void)
|
|||
V_VT(&vDst) = VT_EMPTY;
|
||||
V_UI1(&vDst) = 0;
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, in, 0, VT_UI1);
|
||||
ok(hres == S_OK, "got 0x%08x\n", hres);
|
||||
ok(hres == S_OK, "got 0x%08lx\n", hres);
|
||||
ok(V_VT(&vDst) == VT_UI1, "got %d\n", V_VT(&vDst));
|
||||
ok(V_UI1(&vDst) == 1, "got %d\n", V_UI1(&vDst));
|
||||
CHECK_CALLED(dispatch_invoke);
|
||||
|
@ -908,14 +908,14 @@ static void test_VarUI1FromDisp(void)
|
|||
SET_EXPECT(dispatch_invoke);
|
||||
out = 10;
|
||||
hres = VarUI1FromDisp(&dispatch.IDispatch_iface, in, &out);
|
||||
ok(hres == DISP_E_TYPEMISMATCH, "got 0x%08x\n", hres);
|
||||
ok(hres == DISP_E_TYPEMISMATCH, "got 0x%08lx\n", hres);
|
||||
ok(out == 10, "got %d\n", out);
|
||||
CHECK_CALLED(dispatch_invoke);
|
||||
|
||||
SET_EXPECT(dispatch_invoke);
|
||||
V_VT(&vDst) = VT_EMPTY;
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, in, 0, VT_UI1);
|
||||
ok(hres == DISP_E_TYPEMISMATCH, "got 0x%08x\n", hres);
|
||||
ok(hres == DISP_E_TYPEMISMATCH, "got 0x%08lx\n", hres);
|
||||
ok(V_VT(&vDst) == VT_EMPTY, "got %d\n", V_VT(&vDst));
|
||||
CHECK_CALLED(dispatch_invoke);
|
||||
}
|
||||
|
@ -1418,7 +1418,7 @@ static void test_VarUI2ChangeTypeEx(void)
|
|||
#undef CONV_TYPE
|
||||
#define CONV_TYPE LONG
|
||||
#undef EXPECTRES
|
||||
#define EXPECTRES(res, x) _EXPECTRES(res, x, "%d")
|
||||
#define EXPECTRES(res, x) _EXPECTRES(res, x, "%ld")
|
||||
|
||||
static void test_VarI4FromI1(void)
|
||||
{
|
||||
|
@ -1632,7 +1632,7 @@ static void test_VarI4FromStr(void)
|
|||
|
||||
static void test_VarI4Copy(void)
|
||||
{
|
||||
COPYTEST(1, VT_I4, V_I4(&vSrc), V_I4(&vDst), V_I4REF(&vSrc), V_I4REF(&vDst), "%d");
|
||||
COPYTEST(1l, VT_I4, V_I4(&vSrc), V_I4(&vDst), V_I4REF(&vSrc), V_I4REF(&vDst), "%ld");
|
||||
}
|
||||
|
||||
static void test_VarI4ChangeTypeEx(void)
|
||||
|
@ -1643,15 +1643,15 @@ static void test_VarI4ChangeTypeEx(void)
|
|||
|
||||
in = 1;
|
||||
|
||||
INITIAL_TYPETEST(VT_I4, V_I4, "%d");
|
||||
INITIAL_TYPETEST(VT_I4, V_I4, "%ld");
|
||||
COMMON_TYPETEST;
|
||||
NEGATIVE_TYPETEST(VT_I4, V_I4, "%d", VT_UI4, V_UI4);
|
||||
NEGATIVE_TYPETEST(VT_I4, V_I4, "%ld", VT_UI4, V_UI4);
|
||||
}
|
||||
|
||||
#undef CONV_TYPE
|
||||
#define CONV_TYPE ULONG
|
||||
#undef EXPECTRES
|
||||
#define EXPECTRES(res, x) _EXPECTRES(res, x, "%u")
|
||||
#define EXPECTRES(res, x) _EXPECTRES(res, x, "%lu")
|
||||
|
||||
static void test_VarUI4FromI1(void)
|
||||
{
|
||||
|
@ -1854,7 +1854,7 @@ static void test_VarUI4FromStr(void)
|
|||
|
||||
static void test_VarUI4Copy(void)
|
||||
{
|
||||
COPYTEST(1u, VT_UI4, V_UI4(&vSrc), V_UI4(&vDst), V_UI4REF(&vSrc), V_UI4REF(&vDst), "%u");
|
||||
COPYTEST(1lu, VT_UI4, V_UI4(&vSrc), V_UI4(&vDst), V_UI4REF(&vSrc), V_UI4REF(&vDst), "%lu");
|
||||
}
|
||||
|
||||
static void test_VarUI4ChangeTypeEx(void)
|
||||
|
@ -1865,9 +1865,9 @@ static void test_VarUI4ChangeTypeEx(void)
|
|||
|
||||
in = 1;
|
||||
|
||||
INITIAL_TYPETEST(VT_UI4, V_UI4, "%u");
|
||||
INITIAL_TYPETEST(VT_UI4, V_UI4, "%lu");
|
||||
COMMON_TYPETEST;
|
||||
NEGATIVE_TYPETEST(VT_UI4, V_UI4, "%u", VT_I4, V_I4);
|
||||
NEGATIVE_TYPETEST(VT_UI4, V_UI4, "%lu", VT_I4, V_I4);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3118,7 +3118,7 @@ static void test_VarDateChangeTypeEx(void)
|
|||
hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, VARIANT_NOUSEROVERRIDE, VT_BSTR);
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_BSTR && V_BSTR(&vDst) &&
|
||||
(!lstrcmpW(V_BSTR(&vDst), sz25570) || !lstrcmpW(V_BSTR(&vDst), sz25570_2)),
|
||||
"hres=0x%X, type=%d (should be VT_BSTR), *bstr=%s\n",
|
||||
"hres=0x%lX, type=%d (should be VT_BSTR), *bstr=%s\n",
|
||||
hres, V_VT(&vDst), V_BSTR(&vDst) ? wtoascii(V_BSTR(&vDst)) : "?");
|
||||
VariantClear(&vDst);
|
||||
|
||||
|
@ -3127,7 +3127,7 @@ static void test_VarDateChangeTypeEx(void)
|
|||
{
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, VARIANT_NOUSEROVERRIDE|VARIANT_USE_NLS, VT_BSTR);
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_BSTR && V_BSTR(&vDst) && !lstrcmpW(V_BSTR(&vDst), sz25570Nls),
|
||||
"hres=0x%X, type=%d (should be VT_BSTR), *bstr=%s\n",
|
||||
"hres=0x%lX, type=%d (should be VT_BSTR), *bstr=%s\n",
|
||||
hres, V_VT(&vDst), V_BSTR(&vDst) ? wtoascii(V_BSTR(&vDst)) : "?");
|
||||
VariantClear(&vDst);
|
||||
}
|
||||
|
@ -3142,11 +3142,11 @@ static void test_VarDateChangeTypeEx(void)
|
|||
|
||||
#define EXPECTCY(x) \
|
||||
ok((hres == S_OK && out.int64 == (LONGLONG)(x*CY_MULTIPLIER)), \
|
||||
"expected " #x "*CY_MULTIPLIER, got (%8x %8x); hres=0x%08x\n", S(out).Hi, S(out).Lo, hres)
|
||||
"expected " #x "*CY_MULTIPLIER, got (%8lx %8lx); hres=0x%08lx\n", S(out).Hi, S(out).Lo, hres)
|
||||
|
||||
#define EXPECTCY64(x,y) \
|
||||
ok(hres == S_OK && S(out).Hi == (LONG)x && S(out).Lo == y, \
|
||||
"expected " #x " " #y " (%u,%u), got (%u,%u); hres=0x%08x\n", \
|
||||
"expected " #x " " #y " (%lu,%lu), got (%lu,%lu); hres=0x%08lx\n", \
|
||||
(ULONG)(x), (ULONG)(y), S(out).Hi, S(out).Lo, hres)
|
||||
|
||||
static void test_VarCyFromI1(void)
|
||||
|
@ -3618,7 +3618,7 @@ static void test_VarCyInt(void)
|
|||
#define EXPECTDEC(scl, sgn, hi, lo) ok(hres == S_OK && \
|
||||
S(U(out)).scale == (BYTE)(scl) && S(U(out)).sign == (BYTE)(sgn) && \
|
||||
out.Hi32 == (ULONG)(hi) && U1(out).Lo64 == (ULONG64)(lo), \
|
||||
"expected (%d,%d,%d,(%x %x)), got (%d,%d,%d,(%x %x)) hres 0x%08x\n", \
|
||||
"expected (%d,%d,%d,(%lx %lx)), got (%d,%d,%ld,(%lx %lx)) hres 0x%08lx\n", \
|
||||
scl, sgn, hi, (LONG)((LONG64)(lo) >> 32), (LONG)((lo) & 0xffffffff), S(U(out)).scale, \
|
||||
S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres)
|
||||
|
||||
|
@ -3626,14 +3626,14 @@ static void test_VarCyInt(void)
|
|||
S(U(out)).scale == (BYTE)(scl) && S(U(out)).sign == (BYTE)(sgn) && \
|
||||
out.Hi32 == (ULONG)(hi) && S1(U1(out)).Mid32 == (ULONG)(mid) && \
|
||||
S1(U1(out)).Lo32 == (ULONG)(lo), \
|
||||
"expected (%d,%d,%d,(%x %x)), got (%d,%d,%d,(%x %x)) hres 0x%08x\n", \
|
||||
"expected (%d,%d,%d,(%lx %lx)), got (%d,%d,%ld,(%lx %lx)) hres 0x%08lx\n", \
|
||||
scl, sgn, hi, (LONG)(mid), (LONG)(lo), S(U(out)).scale, \
|
||||
S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres)
|
||||
|
||||
/* expect either a positive or negative zero */
|
||||
#define EXPECTDECZERO() ok(hres == S_OK && S(U(out)).scale == 0 && \
|
||||
(S(U(out)).sign == 0 || S(U(out)).sign == 0x80) && out.Hi32 == 0 && U1(out).Lo64 == 0, \
|
||||
"expected zero, got (%d,%d,%d,(%x %x)) hres 0x%08x\n", \
|
||||
"expected zero, got (%d,%d,%ld,(%lx %lx)) hres 0x%08lx\n", \
|
||||
S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres)
|
||||
|
||||
#define EXPECTDECI if (i < 0) EXPECTDEC(0, 0x80, 0, -i); else EXPECTDEC(0, 0, 0, i)
|
||||
|
@ -3887,14 +3887,14 @@ static void test_VarDecAdd(void)
|
|||
SETDEC64(l,0,0,0xffffffff,0xffffffff,0xffffffff);SETDEC(r,0,0x80,0,1); MATH2(VarDecAdd);
|
||||
EXPECTDEC64(0,0,0xffffffff,0xffffffff,0xfffffffe);
|
||||
SETDEC64(l,0,0,0xffffffff,0xffffffff,0xffffffff);SETDEC(r,0,0,0,1); MATH2(VarDecAdd);
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n",
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%ld,(%8lx,%8lx)x) hres 0x%08lx\n",
|
||||
S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres);
|
||||
|
||||
SETDEC64(l,1,0,0xffffffff,0xffffffff,0xffffffff);SETDEC(r,1,0,0,1); MATH2(VarDecAdd);
|
||||
EXPECTDEC64(0,0,0x19999999,0x99999999,0x9999999A);
|
||||
|
||||
SETDEC64(l,0,0,0xe22ea493,0xb30310a7,0x70000000);SETDEC64(r,0,0,0xe22ea493,0xb30310a7,0x70000000); MATH2(VarDecAdd);
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n",
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%ld,(%8lx,%8lx)x) hres 0x%08lx\n",
|
||||
S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres);
|
||||
|
||||
SETDEC64(l,1,0,0xe22ea493,0xb30310a7,0x70000000);SETDEC64(r,1,0,0xe22ea493,0xb30310a7,0x70000000); MATH2(VarDecAdd);
|
||||
|
@ -3904,15 +3904,15 @@ static void test_VarDecAdd(void)
|
|||
MATH2(VarDecAdd); EXPECTDEC64(0,0,-1,0xFFFFFFFF,0xFFFFFF84);
|
||||
|
||||
SETDEC(l,3,0,0,123456); SETDEC64(r,0,0,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF); MATH2(VarDecAdd);
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n",
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%ld,(%8lx,%8lx)x) hres 0x%08lx\n",
|
||||
S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres);
|
||||
|
||||
SETDEC(l,4,0,0,123456); SETDEC64(r,0,0,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF); MATH2(VarDecAdd);
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n",
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%ld,(%8lx,%8lx)x) hres 0x%08lx\n",
|
||||
S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres);
|
||||
|
||||
SETDEC(l,5,0,0,123456); SETDEC64(r,0,0,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF); MATH2(VarDecAdd);
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n",
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%ld,(%8lx,%8lx)x) hres 0x%08lx\n",
|
||||
S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres);
|
||||
|
||||
SETDEC(l,6,0,0,123456); SETDEC64(r,0,0,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF);
|
||||
|
@ -3971,7 +3971,7 @@ static void test_VarDecMul(void)
|
|||
SETDEC64(l,0,0,0,0xFFFFFFFF,0xFFFFFFFF); SETDEC(r,0,0,0,2000000000); MATH2(VarDecMul);EXPECTDEC64(0,0,1999999999,0xFFFFFFFF,0x88CA6C00);
|
||||
/* actual overflow - right operand is 10 times the previous value */
|
||||
SETDEC64(l,0,0,0,0xFFFFFFFF,0xFFFFFFFF); SETDEC64(r,0,0,0,4,0xA817C800); MATH2(VarDecMul);
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n",
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%ld,(%8lx,%8lx)x) hres 0x%08lx\n",
|
||||
S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres);
|
||||
/* here, native oleaut32 has an opportunity to avert the overflow, by reducing the scale of the result */
|
||||
SETDEC64(l,1,0,0,0xFFFFFFFF,0xFFFFFFFF); SETDEC64(r,0,0,0,4,0xA817C800); MATH2(VarDecMul);EXPECTDEC64(0,0,1999999999,0xFFFFFFFF,0x88CA6C00);
|
||||
|
@ -3980,7 +3980,7 @@ static void test_VarDecMul(void)
|
|||
SETDEC64(l,0,0,1,0xFFFFFFFF,0xFFFFFFFE); SETDEC(r,0,0,0,1000000000); MATH2(VarDecMul);EXPECTDEC64(0,0,1999999999,0xFFFFFFFF,0x88CA6C00);
|
||||
/* actual overflow - right operand is 10 times the previous value */
|
||||
SETDEC64(l,0,0,1,0xFFFFFFFF,0xFFFFFFFE); SETDEC64(r,0,0,0,2,0x540BE400); MATH2(VarDecMul);
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n",
|
||||
ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%ld,(%8lx,%8lx)x) hres 0x%08lx\n",
|
||||
S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres);
|
||||
/* here, native oleaut32 has an opportunity to avert the overflow, by reducing the scale of the result */
|
||||
SETDEC64(l,1,0,1,0xFFFFFFFF,0xFFFFFFFE); SETDEC64(r,0,0,0,2,0x540BE400); MATH2(VarDecMul);EXPECTDEC64(0,0,1999999999,0xFFFFFFFF,0x88CA6C00);
|
||||
|
@ -4030,10 +4030,10 @@ static void test_VarDecDiv(void)
|
|||
|
||||
/* oddballs */
|
||||
SETDEC(l,0,0,0,0); SETDEC(r,0,0,0,0); MATH2(VarDecDiv);/* indeterminate */
|
||||
ok(hres == DISP_E_DIVBYZERO,"Expected division-by-zero, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n",
|
||||
ok(hres == DISP_E_DIVBYZERO,"Expected division-by-zero, got (%d,%d,%ld,(%8lx,%8lx)x) hres 0x%08lx\n",
|
||||
S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres);
|
||||
SETDEC(l,0,0,0,1); SETDEC(r,0,0,0,0); MATH2(VarDecDiv);/* division by zero */
|
||||
ok(hres == DISP_E_DIVBYZERO,"Expected division-by-zero, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n",
|
||||
ok(hres == DISP_E_DIVBYZERO,"Expected division-by-zero, got (%d,%d,%ld,(%8lx,%8lx)x) hres 0x%08lx\n",
|
||||
S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres);
|
||||
|
||||
}
|
||||
|
@ -4436,7 +4436,7 @@ static void test_VarBoolCopy(void)
|
|||
#define BOOL_STR(flags, str) hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, flags, VT_BSTR); \
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_BSTR && \
|
||||
V_BSTR(&vDst) && !memcmp(V_BSTR(&vDst), str, sizeof(str)), \
|
||||
"hres=0x%X, type=%d (should be VT_BSTR), *bstr='%c'\n", \
|
||||
"hres=0x%lX, type=%d (should be VT_BSTR), *bstr='%c'\n", \
|
||||
hres, V_VT(&vDst), V_BSTR(&vDst) ? *V_BSTR(&vDst) : '?'); \
|
||||
VariantClear(&vDst)
|
||||
|
||||
|
@ -4495,7 +4495,7 @@ static void test_VarBstrFromI4(void)
|
|||
|
||||
value = -2147483648;
|
||||
hres = VarBstrFromI4(value, lcid, LOCALE_NOUSEROVERRIDE, &bstr);
|
||||
ok(hres == S_OK, "got hres 0x%08x\n", hres);
|
||||
ok(hres == S_OK, "got hres 0x%08lx\n", hres);
|
||||
if (bstr)
|
||||
{
|
||||
ok(memcmp(bstr, int_min, sizeof(int_min)) == 0, "string different\n");
|
||||
|
@ -4504,7 +4504,7 @@ static void test_VarBstrFromI4(void)
|
|||
|
||||
value = -42;
|
||||
hres = VarBstrFromI4(value, lcid, LOCALE_NOUSEROVERRIDE, &bstr);
|
||||
ok(hres == S_OK, "got hres 0x%08x\n", hres);
|
||||
ok(hres == S_OK, "got hres 0x%08lx\n", hres);
|
||||
if (bstr)
|
||||
{
|
||||
ok(memcmp(bstr, minus_42, sizeof(minus_42)) == 0, "string different\n");
|
||||
|
@ -4529,7 +4529,7 @@ static void test_VarBstrFromR4(void)
|
|||
lcid_spanish = MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH), SORT_DEFAULT);
|
||||
f = 654322.23456f;
|
||||
hres = VarBstrFromR4(f, lcid, 0, &bstr);
|
||||
ok(hres == S_OK, "got hres 0x%08x\n", hres);
|
||||
ok(hres == S_OK, "got hres 0x%08lx\n", hres);
|
||||
if (bstr)
|
||||
{
|
||||
ok(memcmp(bstr, szNative, sizeof(szNative)) == 0, "string different\n");
|
||||
|
@ -4538,7 +4538,7 @@ static void test_VarBstrFromR4(void)
|
|||
|
||||
f = -0.0;
|
||||
hres = VarBstrFromR4(f, lcid, 0, &bstr);
|
||||
ok(hres == S_OK, "got hres 0x%08x\n", hres);
|
||||
ok(hres == S_OK, "got hres 0x%08lx\n", hres);
|
||||
if (bstr)
|
||||
{
|
||||
if (bstr[0] == '-')
|
||||
|
@ -4551,7 +4551,7 @@ static void test_VarBstrFromR4(void)
|
|||
/* The following tests that lcid is used for decimal separator even without LOCALE_USE_NLS */
|
||||
f = 0.5;
|
||||
hres = VarBstrFromR4(f, lcid, LOCALE_NOUSEROVERRIDE, &bstr);
|
||||
ok(hres == S_OK, "got hres 0x%08x\n", hres);
|
||||
ok(hres == S_OK, "got hres 0x%08lx\n", hres);
|
||||
if (bstr)
|
||||
{
|
||||
ok(memcmp(bstr, szOneHalf_English, sizeof(szOneHalf_English)) == 0, "English locale failed (got %s)\n", wtoascii(bstr));
|
||||
|
@ -4559,7 +4559,7 @@ static void test_VarBstrFromR4(void)
|
|||
}
|
||||
f = 0.5;
|
||||
hres = VarBstrFromR4(f, lcid_spanish, LOCALE_NOUSEROVERRIDE, &bstr);
|
||||
ok(hres == S_OK, "got hres 0x%08x\n", hres);
|
||||
ok(hres == S_OK, "got hres 0x%08lx\n", hres);
|
||||
if (bstr)
|
||||
{
|
||||
ok(memcmp(bstr, szOneHalf_Spanish, sizeof(szOneHalf_Spanish)) == 0, "Spanish locale failed (got %s)\n", wtoascii(bstr));
|
||||
|
@ -4583,7 +4583,7 @@ static void _BSTR_DATE(DATE dt, const char *str, int line)
|
|||
else
|
||||
buff[0] = 0;
|
||||
ok_(__FILE__, line)(hres == S_OK && !strcmp(str, buff),
|
||||
"Expected '%s', got '%s', hres = 0x%08x\n", str, buff, hres);
|
||||
"Expected '%s', got '%s', hres = 0x%08lx\n", str, buff, hres);
|
||||
}
|
||||
|
||||
static void test_VarBstrFromDate(void)
|
||||
|
@ -4614,7 +4614,7 @@ static void _BSTR_CY(LONG a, LONG b, const char *str, LCID lcid, int line)
|
|||
S(l).Lo = b;
|
||||
S(l).Hi = a;
|
||||
hr = VarBstrFromCy(l, lcid, LOCALE_NOUSEROVERRIDE, &bstr);
|
||||
ok(hr == S_OK, "got hr 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got hr 0x%08lx\n", hr);
|
||||
|
||||
if(bstr)
|
||||
{
|
||||
|
@ -4665,7 +4665,7 @@ static void _BSTR_DEC(BYTE scale, BYTE sign, ULONG hi, ULONG mid, ULONGLONG lo,
|
|||
|
||||
SETDEC64(dec, scale, sign, hi, mid, lo);
|
||||
hr = VarBstrFromDec(&dec, lcid, LOCALE_NOUSEROVERRIDE, &bstr);
|
||||
ok_(__FILE__, line)(hr == S_OK, "got hr 0x%08x\n", hr);
|
||||
ok_(__FILE__, line)(hr == S_OK, "got hr 0x%08lx\n", hr);
|
||||
|
||||
if(bstr)
|
||||
{
|
||||
|
@ -4739,7 +4739,7 @@ static void test_VarBstrFromDec(void)
|
|||
|
||||
#define _VARBSTRCMP(left,right,lcid,flags,result) \
|
||||
hres = VarBstrCmp(left,right,lcid,flags); \
|
||||
ok(hres == result, "VarBstrCmp: expected " #result ", got hres=0x%x\n", hres)
|
||||
ok(hres == result, "VarBstrCmp: expected " #result ", got hres=%#lx\n", hres)
|
||||
#define VARBSTRCMP(left,right,flags,result) \
|
||||
_VARBSTRCMP(left,right,lcid,flags,result)
|
||||
|
||||
|
@ -4872,7 +4872,7 @@ static void test_SysAllocString(void)
|
|||
DWORD_PTR p = (DWORD_PTR)str;
|
||||
int align = sizeof(void *);
|
||||
|
||||
ok (bstr->dwLen == 8, "Expected 8, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 8, "Expected 8, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpW(bstr->szString, szTest), "String different\n");
|
||||
ok ((p & ~(align-1)) == p, "Not aligned to %d\n", align);
|
||||
SysFreeString(str);
|
||||
|
@ -4897,7 +4897,7 @@ static void test_SysAllocStringLen(void)
|
|||
{
|
||||
LPINTERNAL_BSTR bstr = Get(str);
|
||||
|
||||
ok (bstr->dwLen == 0, "Expected 0, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 0, "Expected 0, got %ld\n", bstr->dwLen);
|
||||
ok (!bstr->szString[0], "String not empty\n");
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
@ -4908,7 +4908,7 @@ static void test_SysAllocStringLen(void)
|
|||
{
|
||||
LPINTERNAL_BSTR bstr = Get(str);
|
||||
|
||||
ok (bstr->dwLen == 8, "Expected 8, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 8, "Expected 8, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpW(bstr->szString, szTest), "String different\n");
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
@ -4937,7 +4937,7 @@ static void test_SysAllocStringByteLen(void)
|
|||
{
|
||||
LPINTERNAL_BSTR bstr = Get(str);
|
||||
|
||||
ok (bstr->dwLen == 0, "Expected 0, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 0, "Expected 0, got %ld\n", bstr->dwLen);
|
||||
ok (!bstr->szString[0], "String not empty\n");
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
@ -4948,7 +4948,7 @@ static void test_SysAllocStringByteLen(void)
|
|||
{
|
||||
LPINTERNAL_BSTR bstr = Get(str);
|
||||
|
||||
ok (bstr->dwLen == 4, "Expected 4, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 4, "Expected 4, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpA((LPCSTR)bstr->szString, szTestA), "String different\n");
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
@ -4961,7 +4961,7 @@ static void test_SysAllocStringByteLen(void)
|
|||
const CHAR szTestTruncA[4] = { 'T','e','s','\0' };
|
||||
LPINTERNAL_BSTR bstr = Get(str);
|
||||
|
||||
ok (bstr->dwLen == 3, "Expected 3, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 3, "Expected 3, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpA((LPCSTR)bstr->szString, szTestTruncA), "String different\n");
|
||||
ok (!bstr->szString[2], "String not terminated\n");
|
||||
SysFreeString(str);
|
||||
|
@ -4973,7 +4973,7 @@ static void test_SysAllocStringByteLen(void)
|
|||
{
|
||||
LPINTERNAL_BSTR bstr = Get(str);
|
||||
|
||||
ok (bstr->dwLen == 8, "Expected 8, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 8, "Expected 8, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpW(bstr->szString, szTest), "String different\n");
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
@ -4988,7 +4988,7 @@ static void test_SysAllocStringByteLen(void)
|
|||
str = SysAllocStringByteLen(NULL, i);
|
||||
ok (str != NULL, "Expected non-NULL\n");
|
||||
bstr = Get(str);
|
||||
ok (bstr->dwLen == i, "Expected %d, got %d\n", i, bstr->dwLen);
|
||||
ok (bstr->dwLen == i, "Expected %d, got %ld\n", i, bstr->dwLen);
|
||||
ok (!bstr->szString[(i+sizeof(WCHAR)-1)/sizeof(WCHAR)], "String not terminated\n");
|
||||
SysFreeString(str);
|
||||
|
||||
|
@ -4996,7 +4996,7 @@ static void test_SysAllocStringByteLen(void)
|
|||
str = SysAllocStringByteLen(buf, i);
|
||||
ok (str != NULL, "Expected non-NULL\n");
|
||||
bstr = Get(str);
|
||||
ok (bstr->dwLen == i, "Expected %d, got %d\n", i, bstr->dwLen);
|
||||
ok (bstr->dwLen == i, "Expected %d, got %ld\n", i, bstr->dwLen);
|
||||
buf[i] = 0;
|
||||
ok (!lstrcmpA((LPCSTR)bstr->szString, buf), "String different\n");
|
||||
ok (!bstr->szString[(i+sizeof(WCHAR)-1)/sizeof(WCHAR)], "String not terminated\n");
|
||||
|
@ -5020,7 +5020,7 @@ static void test_SysReAllocString(void)
|
|||
int changed;
|
||||
|
||||
bstr = Get(str);
|
||||
ok (bstr->dwLen == 8, "Expected 8, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 8, "Expected 8, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpW(bstr->szString, szTest), "String different\n");
|
||||
|
||||
changed = SysReAllocString(&str, szSmaller);
|
||||
|
@ -5028,7 +5028,7 @@ static void test_SysReAllocString(void)
|
|||
/* Vista creates a new string, but older versions reuse the existing string. */
|
||||
/*ok (str == oldstr, "Created new string\n");*/
|
||||
bstr = Get(str);
|
||||
ok (bstr->dwLen == 2, "Expected 2, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 2, "Expected 2, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpW(bstr->szString, szSmaller), "String different\n");
|
||||
|
||||
changed = SysReAllocString(&str, szLarger);
|
||||
|
@ -5036,7 +5036,7 @@ static void test_SysReAllocString(void)
|
|||
/* Early versions always make new strings rather than resizing */
|
||||
/* ok (str == oldstr, "Created new string\n"); */
|
||||
bstr = Get(str);
|
||||
ok (bstr->dwLen == 12, "Expected 12, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 12, "Expected 12, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpW(bstr->szString, szLarger), "String different\n");
|
||||
|
||||
SysFreeString(str);
|
||||
|
@ -5058,7 +5058,7 @@ static void test_SysReAllocStringLen(void)
|
|||
int changed;
|
||||
|
||||
bstr = Get(str);
|
||||
ok (bstr->dwLen == 8, "Expected 8, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 8, "Expected 8, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpW(bstr->szString, szTest), "String different\n");
|
||||
|
||||
changed = SysReAllocStringLen(&str, szSmaller, 1);
|
||||
|
@ -5066,7 +5066,7 @@ static void test_SysReAllocStringLen(void)
|
|||
/* Vista creates a new string, but older versions reuse the existing string. */
|
||||
/*ok (str == oldstr, "Created new string\n");*/
|
||||
bstr = Get(str);
|
||||
ok (bstr->dwLen == 2, "Expected 2, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 2, "Expected 2, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpW(bstr->szString, szSmaller), "String different\n");
|
||||
|
||||
changed = SysReAllocStringLen(&str, szLarger, 6);
|
||||
|
@ -5074,7 +5074,7 @@ static void test_SysReAllocStringLen(void)
|
|||
/* Early versions always make new strings rather than resizing */
|
||||
/* ok (str == oldstr, "Created new string\n"); */
|
||||
bstr = Get(str);
|
||||
ok (bstr->dwLen == 12, "Expected 12, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 12, "Expected 12, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpW(bstr->szString, szLarger), "String different\n");
|
||||
|
||||
changed = SysReAllocStringLen(&str, str, 6);
|
||||
|
@ -5144,9 +5144,9 @@ static void test_BstrCopy(void)
|
|||
V_BSTR(&vt1) = str;
|
||||
V_VT(&vt2) = VT_EMPTY;
|
||||
hres = VariantCopy(&vt2, &vt1);
|
||||
ok (hres == S_OK,"Failed to copy binary bstring with hres 0x%08x\n", hres);
|
||||
ok (hres == S_OK,"Failed to copy binary bstring with hres 0x%08lx\n", hres);
|
||||
bstr = Get(V_BSTR(&vt2));
|
||||
ok (bstr->dwLen == 3, "Expected 3, got %d\n", bstr->dwLen);
|
||||
ok (bstr->dwLen == 3, "Expected 3, got %ld\n", bstr->dwLen);
|
||||
ok (!lstrcmpA((LPCSTR)bstr->szString, szTestTruncA), "String different\n");
|
||||
VariantClear(&vt2);
|
||||
VariantClear(&vt1);
|
||||
|
@ -5175,7 +5175,7 @@ if (0)
|
|||
|
||||
/* Concatenation of two NULL strings works */
|
||||
ret = VarBstrCat(NULL, NULL, &res);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08lx\n", ret);
|
||||
ok(res != NULL, "Expected a string\n");
|
||||
ok(SysStringLen(res) == 0, "Expected a 0-length string\n");
|
||||
SysFreeString(res);
|
||||
|
@ -5184,13 +5184,13 @@ if (0)
|
|||
|
||||
/* Concatenation with one NULL arg */
|
||||
ret = VarBstrCat(NULL, str1, &res);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08lx\n", ret);
|
||||
ok(res != NULL, "Expected a string\n");
|
||||
ok(SysStringLen(res) == SysStringLen(str1), "Unexpected length\n");
|
||||
ok(!memcmp(res, sz1, SysStringLen(str1)), "Unexpected value\n");
|
||||
SysFreeString(res);
|
||||
ret = VarBstrCat(str1, NULL, &res);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08lx\n", ret);
|
||||
ok(res != NULL, "Expected a string\n");
|
||||
ok(SysStringLen(res) == SysStringLen(str1), "Unexpected length\n");
|
||||
ok(!memcmp(res, sz1, SysStringLen(str1)), "Unexpected value\n");
|
||||
|
@ -5199,7 +5199,7 @@ if (0)
|
|||
/* Concatenation of two zero-terminated strings */
|
||||
str2 = SysAllocString(sz2);
|
||||
ret = VarBstrCat(str1, str2, &res);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08lx\n", ret);
|
||||
ok(res != NULL, "Expected a string\n");
|
||||
ok(SysStringLen(res) == ARRAY_SIZE(sz1sz2) - 1, "Unexpected length\n");
|
||||
ok(!memcmp(res, sz1sz2, sizeof(sz1sz2)), "Unexpected value\n");
|
||||
|
@ -5213,7 +5213,7 @@ if (0)
|
|||
str2 = SysAllocStringLen(s2, ARRAY_SIZE(s2));
|
||||
|
||||
ret = VarBstrCat(str1, str2, &res);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08lx\n", ret);
|
||||
ok(res != NULL, "Expected a string\n");
|
||||
ok(SysStringLen(res) == ARRAY_SIZE(s1s2), "Unexpected length\n");
|
||||
ok(!memcmp(res, s1s2, sizeof(s1s2)), "Unexpected value\n");
|
||||
|
@ -5231,7 +5231,7 @@ if (0)
|
|||
ok(len == (sizeof(str2A)-1)/sizeof(WCHAR), "got length %u\n", len);
|
||||
|
||||
ret = VarBstrCat(str1, str2, &res);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08lx\n", ret);
|
||||
ok(res != NULL, "Expected a string\n");
|
||||
len = (sizeof(str1A) + sizeof(str2A) - 2)/sizeof(WCHAR);
|
||||
ok(SysStringLen(res) == len, "got %d, expected %u\n", SysStringLen(res), len);
|
||||
|
@ -5250,7 +5250,7 @@ if (0)
|
|||
ok(len == 0, "got length %u\n", len);
|
||||
|
||||
ret = VarBstrCat(str1, str2, &res);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret);
|
||||
ok(ret == S_OK, "VarBstrCat failed: %08lx\n", ret);
|
||||
ok(res != NULL, "Expected a string\n");
|
||||
ok(SysStringLen(res) == 1, "got %d, expected 1\n", SysStringLen(res));
|
||||
ok(!memcmp(res, "HA", 2), "got (%s)\n", (char*)res);
|
||||
|
@ -5277,7 +5277,7 @@ static void test_IUnknownClear(void)
|
|||
V_UNKNOWN(&v) = (IUnknown*)&u.IDispatch_iface;
|
||||
hres = VariantClear(&v);
|
||||
ok(hres == S_OK && u.ref == 0 && V_VT(&v) == VT_EMPTY,
|
||||
"clear unknown: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"clear unknown: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 0, VT_EMPTY, hres, u.ref, V_VT(&v));
|
||||
|
||||
/* But not when clearing a by-reference*/
|
||||
|
@ -5286,7 +5286,7 @@ static void test_IUnknownClear(void)
|
|||
V_UNKNOWNREF(&v) = &pu;
|
||||
hres = VariantClear(&v);
|
||||
ok(hres == S_OK && u.ref == 1 && V_VT(&v) == VT_EMPTY,
|
||||
"clear dispatch: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"clear dispatch: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 1, VT_EMPTY, hres, u.ref, V_VT(&v));
|
||||
}
|
||||
|
||||
|
@ -5306,7 +5306,7 @@ static void test_IUnknownCopy(void)
|
|||
V_UNKNOWN(&vSrc) = pu;
|
||||
hres = VariantCopy(&vDst, &vSrc);
|
||||
ok(hres == S_OK && u.ref == 2 && V_VT(&vDst) == VT_UNKNOWN,
|
||||
"copy unknown: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"copy unknown: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 2, VT_EMPTY, hres, u.ref, V_VT(&vDst));
|
||||
|
||||
/* AddRef is skipped on copy of by-reference IDispatch */
|
||||
|
@ -5316,7 +5316,7 @@ static void test_IUnknownCopy(void)
|
|||
V_UNKNOWNREF(&vSrc) = &pu;
|
||||
hres = VariantCopy(&vDst, &vSrc);
|
||||
ok(hres == S_OK && u.ref == 1 && V_VT(&vDst) == (VT_UNKNOWN|VT_BYREF),
|
||||
"copy unknown: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"copy unknown: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 1, VT_DISPATCH, hres, u.ref, V_VT(&vDst));
|
||||
|
||||
/* AddRef is called copying by-reference IDispatch with indirection */
|
||||
|
@ -5326,7 +5326,7 @@ static void test_IUnknownCopy(void)
|
|||
V_UNKNOWNREF(&vSrc) = &pu;
|
||||
hres = VariantCopyInd(&vDst, &vSrc);
|
||||
ok(hres == S_OK && u.ref == 2 && V_VT(&vDst) == VT_UNKNOWN,
|
||||
"copy unknown: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"copy unknown: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 2, VT_DISPATCH, hres, u.ref, V_VT(&vDst));
|
||||
|
||||
/* Indirection in place also calls AddRef */
|
||||
|
@ -5335,7 +5335,7 @@ static void test_IUnknownCopy(void)
|
|||
V_UNKNOWNREF(&vSrc) = &pu;
|
||||
hres = VariantCopyInd(&vSrc, &vSrc);
|
||||
ok(hres == S_OK && u.ref == 2 && V_VT(&vSrc) == VT_UNKNOWN,
|
||||
"copy unknown: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"copy unknown: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 2, VT_DISPATCH, hres, u.ref, V_VT(&vSrc));
|
||||
}
|
||||
|
||||
|
@ -5360,7 +5360,7 @@ static void test_IUnknownChangeTypeEx(void)
|
|||
V_DISPATCH(&vDst) = (void*)0xdeadbeef;
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, 0, VT_DISPATCH);
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_DISPATCH && V_DISPATCH(&vDst) == NULL,
|
||||
"change unk(src,dst): expected 0x%08x,%d,%p, got 0x%08x,%d,%p\n",
|
||||
"change unk(src,dst): expected 0x%08lx,%d,%p, got 0x%08lx,%d,%p\n",
|
||||
S_OK, VT_DISPATCH, NULL, hres, V_VT(&vDst), V_DISPATCH(&vDst));
|
||||
|
||||
V_VT(&vSrc) = VT_UNKNOWN;
|
||||
|
@ -5370,7 +5370,7 @@ static void test_IUnknownChangeTypeEx(void)
|
|||
hres = VariantChangeTypeEx(&vSrc, &vSrc, lcid, 0, VT_DISPATCH);
|
||||
ok(hres == S_OK && u.ref == 1 &&
|
||||
V_VT(&vSrc) == VT_DISPATCH && V_DISPATCH(&vSrc) == (IDispatch*)pu,
|
||||
"change unk(src=src): expected 0x%08x,%d,%d,%p, got 0x%08x,%d,%d,%p\n",
|
||||
"change unk(src=src): expected 0x%08lx,%d,%d,%p, got 0x%08lx,%ld,%d,%p\n",
|
||||
S_OK, 1, VT_DISPATCH, pu, hres, u.ref, V_VT(&vSrc), V_DISPATCH(&vSrc));
|
||||
|
||||
/* =>IDispatch */
|
||||
|
@ -5382,7 +5382,7 @@ static void test_IUnknownChangeTypeEx(void)
|
|||
/* Note vSrc is not cleared, as final refcount is 2 */
|
||||
ok(hres == S_OK && u.ref == 2 &&
|
||||
V_VT(&vDst) == VT_UNKNOWN && V_UNKNOWN(&vDst) == pu,
|
||||
"change unk(src,dst): expected 0x%08x,%d,%d,%p, got 0x%08x,%d,%d,%p\n",
|
||||
"change unk(src,dst): expected 0x%08lx,%d,%d,%p, got 0x%08lx,%ld,%d,%p\n",
|
||||
S_OK, 2, VT_UNKNOWN, pu, hres, u.ref, V_VT(&vDst), V_UNKNOWN(&vDst));
|
||||
|
||||
/* Can't change unknown to anything else */
|
||||
|
@ -5413,7 +5413,7 @@ static void test_IUnknownChangeTypeEx(void)
|
|||
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, 0, vt);
|
||||
ok(hres == hExpected,
|
||||
"change unk(badvar): vt %d expected 0x%08x, got 0x%08x\n",
|
||||
"change unk(badvar): vt %d expected 0x%08lx, got 0x%08lx\n",
|
||||
vt, hExpected, hres);
|
||||
}
|
||||
}
|
||||
|
@ -5435,7 +5435,7 @@ static void test_IDispatchClear(void)
|
|||
V_DISPATCH(&v) = pd;
|
||||
hres = VariantClear(&v);
|
||||
ok(hres == S_OK && d.ref == 0 && V_VT(&v) == VT_EMPTY,
|
||||
"clear dispatch: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"clear dispatch: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 0, VT_EMPTY, hres, d.ref, V_VT(&v));
|
||||
|
||||
d.ref = 1;
|
||||
|
@ -5443,7 +5443,7 @@ static void test_IDispatchClear(void)
|
|||
V_DISPATCHREF(&v) = &pd;
|
||||
hres = VariantClear(&v);
|
||||
ok(hres == S_OK && d.ref == 1 && V_VT(&v) == VT_EMPTY,
|
||||
"clear dispatch: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"clear dispatch: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 1, VT_EMPTY, hres, d.ref, V_VT(&v));
|
||||
}
|
||||
|
||||
|
@ -5464,7 +5464,7 @@ static void test_IDispatchCopy(void)
|
|||
V_DISPATCH(&vSrc) = pd;
|
||||
hres = VariantCopy(&vDst, &vSrc);
|
||||
ok(hres == S_OK && d.ref == 2 && V_VT(&vDst) == VT_DISPATCH,
|
||||
"copy dispatch: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"copy dispatch: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 2, VT_EMPTY, hres, d.ref, V_VT(&vDst));
|
||||
|
||||
VariantInit(&vDst);
|
||||
|
@ -5473,7 +5473,7 @@ static void test_IDispatchCopy(void)
|
|||
V_DISPATCHREF(&vSrc) = &pd;
|
||||
hres = VariantCopy(&vDst, &vSrc);
|
||||
ok(hres == S_OK && d.ref == 1 && V_VT(&vDst) == (VT_DISPATCH|VT_BYREF),
|
||||
"copy dispatch: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"copy dispatch: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 1, VT_DISPATCH, hres, d.ref, V_VT(&vDst));
|
||||
|
||||
VariantInit(&vDst);
|
||||
|
@ -5482,7 +5482,7 @@ static void test_IDispatchCopy(void)
|
|||
V_DISPATCHREF(&vSrc) = &pd;
|
||||
hres = VariantCopyInd(&vDst, &vSrc);
|
||||
ok(hres == S_OK && d.ref == 2 && V_VT(&vDst) == VT_DISPATCH,
|
||||
"copy dispatch: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"copy dispatch: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 2, VT_DISPATCH, hres, d.ref, V_VT(&vDst));
|
||||
|
||||
d.ref = 1;
|
||||
|
@ -5490,7 +5490,7 @@ static void test_IDispatchCopy(void)
|
|||
V_DISPATCHREF(&vSrc) = &pd;
|
||||
hres = VariantCopyInd(&vSrc, &vSrc);
|
||||
ok(hres == S_OK && d.ref == 2 && V_VT(&vSrc) == VT_DISPATCH,
|
||||
"copy dispatch: expected 0x%08x, %d, %d, got 0x%08x, %d, %d\n",
|
||||
"copy dispatch: expected 0x%08lx, %d, %d, got 0x%08lx, %ld, %d\n",
|
||||
S_OK, 2, VT_DISPATCH, hres, d.ref, V_VT(&vSrc));
|
||||
}
|
||||
|
||||
|
@ -5514,7 +5514,7 @@ static void test_IDispatchChangeTypeEx(void)
|
|||
V_UNKNOWN(&vDst) = (void*)0xdeadbeef;
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, 0, VT_UNKNOWN);
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_UNKNOWN && V_UNKNOWN(&vDst) == NULL,
|
||||
"change unk(src,dst): expected 0x%08x,%d,%p, got 0x%08x,%d,%p\n",
|
||||
"change unk(src,dst): expected 0x%08lx,%d,%p, got 0x%08lx,%d,%p\n",
|
||||
S_OK, VT_UNKNOWN, NULL, hres, V_VT(&vDst), V_UNKNOWN(&vDst));
|
||||
|
||||
V_VT(&vSrc) = VT_DISPATCH;
|
||||
|
@ -5524,7 +5524,7 @@ static void test_IDispatchChangeTypeEx(void)
|
|||
hres = VariantChangeTypeEx(&vSrc, &vSrc, lcid, 0, VT_UNKNOWN);
|
||||
ok(hres == S_OK && d.ref == 1 &&
|
||||
V_VT(&vSrc) == VT_UNKNOWN && V_UNKNOWN(&vSrc) == (IUnknown*)pd,
|
||||
"change disp(src=src): expected 0x%08x,%d,%d,%p, got 0x%08x,%d,%d,%p\n",
|
||||
"change disp(src=src): expected 0x%08lx,%d,%d,%p, got 0x%08lx,%ld,%d,%p\n",
|
||||
S_OK, 1, VT_UNKNOWN, pd, hres, d.ref, V_VT(&vSrc), V_UNKNOWN(&vSrc));
|
||||
|
||||
/* =>IUnknown */
|
||||
|
@ -5536,7 +5536,7 @@ static void test_IDispatchChangeTypeEx(void)
|
|||
/* Note vSrc is not cleared, as final refcount is 2 */
|
||||
ok(hres == S_OK && d.ref == 2 &&
|
||||
V_VT(&vDst) == VT_UNKNOWN && V_UNKNOWN(&vDst) == (IUnknown*)pd,
|
||||
"change disp(src,dst): expected 0x%08x,%d,%d,%p, got 0x%08x,%d,%d,%p\n",
|
||||
"change disp(src,dst): expected 0x%08lx,%d,%d,%p, got 0x%08lx,%ld,%d,%p\n",
|
||||
S_OK, 2, VT_UNKNOWN, pd, hres, d.ref, V_VT(&vDst), V_UNKNOWN(&vDst));
|
||||
|
||||
/* FIXME: Verify that VARIANT_NOVALUEPROP prevents conversion to integral
|
||||
|
@ -5581,7 +5581,7 @@ static void test_ErrorChangeTypeEx(void)
|
|||
}
|
||||
|
||||
ok(hres == hExpected,
|
||||
"change err: vt %d expected 0x%08x, got 0x%08x\n", vt, hExpected, hres);
|
||||
"change err: vt %d expected 0x%08lx, got 0x%08lx\n", vt, hExpected, hres);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5647,7 +5647,7 @@ static void test_EmptyChangeTypeEx(void)
|
|||
V_VT(&vDst) = VT_NULL;
|
||||
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, 0, vt);
|
||||
ok(hres == hExpected, "change empty: vt %d expected 0x%08x, got 0x%08x, vt %d\n",
|
||||
ok(hres == hExpected, "change empty: vt %d expected 0x%08lx, got 0x%08lx, vt %d\n",
|
||||
vt, hExpected, hres, V_VT(&vDst));
|
||||
if (hres == S_OK)
|
||||
{
|
||||
|
@ -5719,15 +5719,15 @@ static void test_NullChangeTypeEx(void)
|
|||
V_VT(&vDst) = VT_EMPTY;
|
||||
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, 0, vt);
|
||||
ok(hres == hExpected, "change null: vt %d expected 0x%08x, got 0x%08x, vt %d\n",
|
||||
ok(hres == hExpected, "change null: vt %d expected 0x%08lx, got 0x%08lx, vt %d\n",
|
||||
vt, hExpected, hres, V_VT(&vDst));
|
||||
|
||||
/* should work only for VT_NULL -> VT_NULL case */
|
||||
if (hres == S_OK)
|
||||
ok(V_VT(&vDst) == VT_NULL, "change null: VT_NULL expected 0x%08x, got 0x%08x, vt %d\n",
|
||||
ok(V_VT(&vDst) == VT_NULL, "change null: VT_NULL expected 0x%08lx, got 0x%08lx, vt %d\n",
|
||||
hExpected, hres, V_VT(&vDst));
|
||||
else
|
||||
ok(V_VT(&vDst) == VT_EMPTY, "change null: vt %d expected 0x%08x, got 0x%08x, vt %d\n",
|
||||
ok(V_VT(&vDst) == VT_EMPTY, "change null: vt %d expected 0x%08lx, got 0x%08lx, vt %d\n",
|
||||
vt, hExpected, hres, V_VT(&vDst));
|
||||
}
|
||||
}
|
||||
|
@ -5748,7 +5748,7 @@ static void test_UintChangeTypeEx(void)
|
|||
V_UI4(&vSrc) = -1;
|
||||
hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, 0, VT_I4);
|
||||
ok(hres == S_OK && V_VT(&vDst) == VT_I4 && V_I4(&vDst) == -1,
|
||||
"change uint: Expected %d,0x%08x,%d got %d,0x%08x,%d\n",
|
||||
"change uint: Expected %d,0x%08lx,%d got %d,0x%08lx,%ld\n",
|
||||
VT_I4, S_OK, -1, V_VT(&vDst), hres, V_I4(&vDst));
|
||||
}
|
||||
|
||||
|
@ -5811,19 +5811,19 @@ static void test_ChangeType_keep_dst(void)
|
|||
V_VT(&v1) = VT_BSTR;
|
||||
V_BSTR(&v1) = bstr;
|
||||
hres = VariantChangeTypeEx(&v1, &v1, 0, 0, VT_INT);
|
||||
ok(hres == DISP_E_TYPEMISMATCH, "VariantChangeTypeEx returns %08x\n", hres);
|
||||
ok(hres == DISP_E_TYPEMISMATCH, "VariantChangeTypeEx returns %08lx\n", hres);
|
||||
ok(V_VT(&v1) == VT_BSTR && V_BSTR(&v1) == bstr, "VariantChangeTypeEx changed dst variant\n");
|
||||
V_VT(&v2) = VT_INT;
|
||||
V_INT(&v2) = 4;
|
||||
hres = VariantChangeTypeEx(&v2, &v1, 0, 0, VT_INT);
|
||||
ok(hres == DISP_E_TYPEMISMATCH, "VariantChangeTypeEx returns %08x\n", hres);
|
||||
ok(hres == DISP_E_TYPEMISMATCH, "VariantChangeTypeEx returns %08lx\n", hres);
|
||||
ok(V_VT(&v2) == VT_INT && V_INT(&v2) == 4, "VariantChangeTypeEx changed dst variant\n");
|
||||
V_VT(&v2) = 0xff; /* incorrect variant type */
|
||||
hres = VariantChangeTypeEx(&v2, &v1, 0, 0, VT_INT);
|
||||
ok(hres == DISP_E_TYPEMISMATCH, "VariantChangeTypeEx returns %08x\n", hres);
|
||||
ok(hres == DISP_E_TYPEMISMATCH, "VariantChangeTypeEx returns %08lx\n", hres);
|
||||
ok(V_VT(&v2) == 0xff, "VariantChangeTypeEx changed dst variant\n");
|
||||
hres = VariantChangeTypeEx(&v2, &v1, 0, 0, VT_BSTR);
|
||||
ok(hres == DISP_E_BADVARTYPE, "VariantChangeTypeEx returns %08x\n", hres);
|
||||
ok(hres == DISP_E_BADVARTYPE, "VariantChangeTypeEx returns %08lx\n", hres);
|
||||
ok(V_VT(&v2) == 0xff, "VariantChangeTypeEx changed dst variant\n");
|
||||
SysFreeString(bstr);
|
||||
}
|
||||
|
@ -5930,43 +5930,43 @@ static void test_recinfo(void)
|
|||
filename = create_test_typelib(2);
|
||||
MultiByteToWideChar(CP_ACP, 0, filename, -1, filenameW, MAX_PATH);
|
||||
hr = LoadTypeLibEx(filenameW, REGKIND_NONE, &typelib);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
filename = create_test_typelib(3);
|
||||
MultiByteToWideChar(CP_ACP, 0, filename, -1, filename2W, MAX_PATH);
|
||||
hr = LoadTypeLibEx(filename2W, REGKIND_NONE, &typelib2);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
typeinfo = NULL;
|
||||
found = 1;
|
||||
hr = ITypeLib_FindName(typelib, teststructW, 0, &typeinfo, &memid, &found);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(typeinfo != NULL, "got %p\n", typeinfo);
|
||||
hr = ITypeInfo_GetTypeAttr(typeinfo, &attr);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(IsEqualGUID(&attr->guid, &UUID_test_struct), "got %s\n", wine_dbgstr_guid(&attr->guid));
|
||||
ok(attr->typekind == TKIND_RECORD, "got %d\n", attr->typekind);
|
||||
|
||||
typeinfo2 = NULL;
|
||||
found = 1;
|
||||
hr = ITypeLib_FindName(typelib, teststruct2W, 0, &typeinfo2, &memid, &found);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(typeinfo2 != NULL, "got %p\n", typeinfo2);
|
||||
|
||||
typeinfo3 = NULL;
|
||||
found = 1;
|
||||
hr = ITypeLib_FindName(typelib2, teststruct3W, 0, &typeinfo3, &memid, &found);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(typeinfo3 != NULL, "got %p\n", typeinfo3);
|
||||
|
||||
hr = GetRecordInfoFromTypeInfo(typeinfo, &recinfo);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = GetRecordInfoFromTypeInfo(typeinfo2, &recinfo2);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = GetRecordInfoFromTypeInfo(typeinfo3, &recinfo3);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
/* IsMatchingType, these two records only differ in GUIDs */
|
||||
ret = IRecordInfo_IsMatchingType(recinfo, recinfo2);
|
||||
|
@ -5983,9 +5983,9 @@ static void test_recinfo(void)
|
|||
|
||||
size = 0;
|
||||
hr = IRecordInfo_GetSize(recinfo, &size);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(size == sizeof(struct test_struct), "got size %d\n", size);
|
||||
ok(attr->cbSizeInstance == sizeof(struct test_struct), "got instance size %d\n", attr->cbSizeInstance);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(size == sizeof(struct test_struct), "got size %ld\n", size);
|
||||
ok(attr->cbSizeInstance == sizeof(struct test_struct), "got instance size %ld\n", attr->cbSizeInstance);
|
||||
ITypeInfo_ReleaseTypeAttr(typeinfo, attr);
|
||||
|
||||
/* RecordInit() */
|
||||
|
@ -5995,8 +5995,8 @@ static void test_recinfo(void)
|
|||
teststruct.bstr = (void*)0xdeadbeef;
|
||||
|
||||
hr = IRecordInfo_RecordInit(recinfo, &teststruct);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(teststruct.hr == 0, "got 0x%08x\n", teststruct.hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(teststruct.hr == 0, "got 0x%08lx\n", teststruct.hr);
|
||||
ok(teststruct.b == 0, "got 0x%08x\n", teststruct.b);
|
||||
ok(teststruct.disp == NULL, "got %p\n", teststruct.disp);
|
||||
ok(teststruct.bstr == NULL, "got %p\n", teststruct.bstr);
|
||||
|
@ -6010,20 +6010,20 @@ static void test_recinfo(void)
|
|||
teststruct.bstr = SysAllocString(testW);
|
||||
memset(&testcopy, 0, sizeof(testcopy));
|
||||
hr = IRecordInfo_RecordCopy(recinfo, &teststruct, &testcopy);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(testcopy.hr == S_FALSE, "got 0x%08x\n", testcopy.hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(testcopy.hr == S_FALSE, "got 0x%08lx\n", testcopy.hr);
|
||||
ok(testcopy.b == VARIANT_TRUE, "got %d\n", testcopy.b);
|
||||
ok(testcopy.disp == teststruct.disp, "got %p\n", testcopy.disp);
|
||||
ok(dispatch.ref == 11, "got %d\n", dispatch.ref);
|
||||
ok(dispatch.ref == 11, "got %ld\n", dispatch.ref);
|
||||
ok(testcopy.bstr != teststruct.bstr, "got %p\n", testcopy.bstr);
|
||||
ok(!lstrcmpW(testcopy.bstr, teststruct.bstr), "got %s, %s\n", wine_dbgstr_w(testcopy.bstr), wine_dbgstr_w(teststruct.bstr));
|
||||
|
||||
/* RecordClear() */
|
||||
hr = IRecordInfo_RecordClear(recinfo, &teststruct);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(teststruct.bstr == NULL, "got %p\n", teststruct.bstr);
|
||||
hr = IRecordInfo_RecordClear(recinfo, &testcopy);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(testcopy.bstr == NULL, "got %p\n", testcopy.bstr);
|
||||
|
||||
/* now the destination contains the interface pointer */
|
||||
|
@ -6032,8 +6032,8 @@ static void test_recinfo(void)
|
|||
dispatch.ref = 10;
|
||||
|
||||
hr = IRecordInfo_RecordCopy(recinfo, &teststruct, &testcopy);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(dispatch.ref == 9, "got %d\n", dispatch.ref);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
ok(dispatch.ref == 9, "got %ld\n", dispatch.ref);
|
||||
|
||||
IRecordInfo_Release(recinfo);
|
||||
|
||||
|
@ -6051,7 +6051,7 @@ START_TEST(vartype)
|
|||
has_i8 = GetProcAddress(hOleaut32, "VarI8FromI1") != NULL;
|
||||
has_locales = has_i8 && GetProcAddress(hOleaut32, "GetVarConversionLocaleSetting") != NULL;
|
||||
|
||||
trace("LCIDs: System=0x%08x, User=0x%08x\n", GetSystemDefaultLCID(),
|
||||
trace("LCIDs: System=0x%08lx, User=0x%08lx\n", GetSystemDefaultLCID(),
|
||||
GetUserDefaultLCID());
|
||||
|
||||
test_bstr_cache();
|
||||
|
|
Loading…
Reference in New Issue