Commit 497cb25e authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

oleaut32/tests: Enable compilation with long types.

parent 91475415
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = oleaut32.dll TESTDLL = oleaut32.dll
IMPORTS = oleaut32 ole32 rpcrt4 user32 gdi32 advapi32 IMPORTS = oleaut32 ole32 rpcrt4 user32 gdi32 advapi32
......
...@@ -84,7 +84,7 @@ static void test_DispGetParam(void) ...@@ -84,7 +84,7 @@ static void test_DispGetParam(void)
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 0, VT_I2, &result, &err_index); hr = DispGetParam(&dispparams, 0, VT_I2, &result, &err_index);
ok(hr == DISP_E_PARAMNOTFOUND, 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, ok(V_VT(&result) == VT_EMPTY,
"Expected VT_EMPTY, got %08x\n", V_VT(&result)); "Expected VT_EMPTY, got %08x\n", V_VT(&result));
ok(err_index == 0xdeadbeef, ok(err_index == 0xdeadbeef,
...@@ -96,7 +96,7 @@ static void test_DispGetParam(void) ...@@ -96,7 +96,7 @@ static void test_DispGetParam(void)
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 1, VT_I2, &result, &err_index); hr = DispGetParam(&dispparams, 1, VT_I2, &result, &err_index);
ok(hr == DISP_E_PARAMNOTFOUND, 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, ok(V_VT(&result) == VT_EMPTY,
"Expected VT_EMPTY, got %08x\n", V_VT(&result)); "Expected VT_EMPTY, got %08x\n", V_VT(&result));
ok(err_index == 0xdeadbeef, ok(err_index == 0xdeadbeef,
...@@ -107,7 +107,7 @@ static void test_DispGetParam(void) ...@@ -107,7 +107,7 @@ static void test_DispGetParam(void)
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 0, VT_I2, NULL, &err_index); hr = DispGetParam(&dispparams, 0, VT_I2, NULL, &err_index);
ok(hr == DISP_E_PARAMNOTFOUND, 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, ok(err_index == 0xdeadbeef,
"Expected err_index to be unchanged, got %d\n", err_index); "Expected err_index to be unchanged, got %d\n", err_index);
...@@ -116,7 +116,7 @@ static void test_DispGetParam(void) ...@@ -116,7 +116,7 @@ static void test_DispGetParam(void)
VariantInit(&result); VariantInit(&result);
hr = DispGetParam(&dispparams, 0, VT_I2, &result, NULL); hr = DispGetParam(&dispparams, 0, VT_I2, &result, NULL);
ok(hr == DISP_E_PARAMNOTFOUND, 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, ok(V_VT(&result) == VT_EMPTY,
"Expected VT_EMPTY, got %08x\n", V_VT(&result)); "Expected VT_EMPTY, got %08x\n", V_VT(&result));
...@@ -125,7 +125,7 @@ static void test_DispGetParam(void) ...@@ -125,7 +125,7 @@ static void test_DispGetParam(void)
VariantInit(&result); VariantInit(&result);
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 0, VT_I2, &result, &err_index); 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, ok(V_VT(&result) == VT_EMPTY,
"Expected VT_EMPTY, got %08x\n", V_VT(&result)); "Expected VT_EMPTY, got %08x\n", V_VT(&result));
ok(err_index == 0, "Expected 0, got %d\n", err_index); ok(err_index == 0, "Expected 0, got %d\n", err_index);
...@@ -145,7 +145,7 @@ static void test_DispGetParam(void) ...@@ -145,7 +145,7 @@ static void test_DispGetParam(void)
VariantInit(&result); VariantInit(&result);
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 2, VT_I2, &result, &err_index); 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_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(V_I2(&result) == 42, "Expected 42, got %d\n", V_I2(&result));
ok(err_index == 0xdeadbeef, ok(err_index == 0xdeadbeef,
...@@ -156,10 +156,10 @@ static void test_DispGetParam(void) ...@@ -156,10 +156,10 @@ static void test_DispGetParam(void)
VariantInit(&result); VariantInit(&result);
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 1, VT_I4, &result, &err_index); 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_VT(&result) == VT_I4, "Expected VT_I4, got %08x\n", V_VT(&result));
ok(V_I4(&result) == 1234567890, 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, ok(err_index == 0xdeadbeef,
"Expected err_index to be unchanged, got %d\n", err_index); "Expected err_index to be unchanged, got %d\n", err_index);
...@@ -168,7 +168,7 @@ static void test_DispGetParam(void) ...@@ -168,7 +168,7 @@ static void test_DispGetParam(void)
VariantInit(&result); VariantInit(&result);
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 0, VT_BSTR, &result, &err_index); 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(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_bstr(V_BSTR(&result), "Sunshine", "Expected %s, got %s\n");
ok(err_index == 0xdeadbeef, ok(err_index == 0xdeadbeef,
...@@ -181,7 +181,7 @@ static void test_DispGetParam(void) ...@@ -181,7 +181,7 @@ static void test_DispGetParam(void)
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 3, VT_I2, &result, &err_index); hr = DispGetParam(&dispparams, 3, VT_I2, &result, &err_index);
ok(hr == DISP_E_PARAMNOTFOUND, 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, ok(V_VT(&result) == VT_EMPTY,
"Expected VT_EMPTY, got %08x\n", V_VT(&result)); "Expected VT_EMPTY, got %08x\n", V_VT(&result));
ok(err_index == 0xdeadbeef, ok(err_index == 0xdeadbeef,
...@@ -191,14 +191,14 @@ static void test_DispGetParam(void) ...@@ -191,14 +191,14 @@ static void test_DispGetParam(void)
INIT_DISPPARAMS(dispparams, vararg, NULL, 3, 0); INIT_DISPPARAMS(dispparams, vararg, NULL, 3, 0);
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 2, VT_I2, NULL, &err_index); 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); ok(err_index == 0, "Expected 0, got %d\n", err_index);
/* puArgErr is NULL. */ /* puArgErr is NULL. */
INIT_DISPPARAMS(dispparams, vararg, NULL, 3, 0); INIT_DISPPARAMS(dispparams, vararg, NULL, 3, 0);
VariantInit(&result); VariantInit(&result);
hr = DispGetParam(&dispparams, 2, VT_I2, &result, NULL); 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_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(V_I2(&result) == 42, "Expected 42, got %d\n", V_I2(&result));
...@@ -207,9 +207,9 @@ static void test_DispGetParam(void) ...@@ -207,9 +207,9 @@ static void test_DispGetParam(void)
VariantInit(&result); VariantInit(&result);
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 2, VT_I4, &result, &err_index); 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_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, ok(err_index == 0xdeadbeef,
"Expected err_index to be unchanged, got %d\n", err_index); "Expected err_index to be unchanged, got %d\n", err_index);
...@@ -218,7 +218,7 @@ static void test_DispGetParam(void) ...@@ -218,7 +218,7 @@ static void test_DispGetParam(void)
VariantInit(&result); VariantInit(&result);
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 2, VT_BSTR, &result, &err_index); 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(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_bstr(V_BSTR(&result), "42", "Expected %s, got %s\n");
ok(err_index == 0xdeadbeef, ok(err_index == 0xdeadbeef,
...@@ -230,7 +230,7 @@ static void test_DispGetParam(void) ...@@ -230,7 +230,7 @@ static void test_DispGetParam(void)
VariantInit(&result); VariantInit(&result);
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 1, VT_I2, &result, &err_index); 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, ok(V_VT(&result) == VT_EMPTY,
"Expected VT_EMPTY, got %08x\n", V_VT(&result)); "Expected VT_EMPTY, got %08x\n", V_VT(&result));
ok(err_index == 1, "Expected 1, got %d\n", err_index); ok(err_index == 1, "Expected 1, got %d\n", err_index);
...@@ -241,7 +241,7 @@ static void test_DispGetParam(void) ...@@ -241,7 +241,7 @@ static void test_DispGetParam(void)
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 0, VT_I2, &result, &err_index); hr = DispGetParam(&dispparams, 0, VT_I2, &result, &err_index);
ok(hr == DISP_E_TYPEMISMATCH, 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, ok(V_VT(&result) == VT_EMPTY,
"Expected VT_EMPTY, got %08x\n", V_VT(&result)); "Expected VT_EMPTY, got %08x\n", V_VT(&result));
ok(err_index == 2, "Expected 2, got %d\n", err_index); ok(err_index == 2, "Expected 2, got %d\n", err_index);
...@@ -251,7 +251,7 @@ static void test_DispGetParam(void) ...@@ -251,7 +251,7 @@ static void test_DispGetParam(void)
VariantInit(&result); VariantInit(&result);
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 2, VT_ILLEGAL, &result, &err_index); 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, ok(V_VT(&result) == VT_EMPTY,
"Expected VT_EMPTY, got %08x\n", V_VT(&result)); "Expected VT_EMPTY, got %08x\n", V_VT(&result));
ok(err_index == 0, "Expected 0, got %d\n", err_index); ok(err_index == 0, "Expected 0, got %d\n", err_index);
...@@ -264,7 +264,7 @@ static void test_DispGetParam(void) ...@@ -264,7 +264,7 @@ static void test_DispGetParam(void)
VariantInit(&result); VariantInit(&result);
err_index = 0xdeadbeef; err_index = 0xdeadbeef;
hr = DispGetParam(&dispparams, 0, VT_BSTR, &result, &err_index); 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(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); ok(err_index == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", err_index);
VariantClear(&result); VariantClear(&result);
...@@ -312,25 +312,25 @@ static void test_CreateStdDispatch(void) ...@@ -312,25 +312,25 @@ static void test_CreateStdDispatch(void)
HRESULT hr; HRESULT hr;
hr = CreateStdDispatch(NULL, NULL, NULL, NULL); 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); 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); 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); 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); ITypeLib_Release(tl);
hr = CreateStdDispatch(NULL, &test_unk, NULL, &unk); 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); 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); 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); IUnknown_Release(unk);
ITypeInfo_Release(ti); ITypeInfo_Release(ti);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#define FMT_NUMBER(vt,val) \ #define FMT_NUMBER(vt,val) \
VariantInit(&v); V_VT(&v) = vt; val(&v) = 1; \ VariantInit(&v); V_VT(&v) = vt; val(&v) = 1; \
hres = VarFormatNumber(&v,2,0,0,0,0,&str); \ 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) { \ if (hres == S_OK) { \
ok(str && wcscmp(str,szResult1) == 0, \ ok(str && wcscmp(str,szResult1) == 0, \
"VarFormatNumber (vt %d): string different\n", vt); \ "VarFormatNumber (vt %d): string different\n", vt); \
...@@ -78,7 +78,7 @@ static void test_VarFormatNumber(void) ...@@ -78,7 +78,7 @@ static void test_VarFormatNumber(void)
V_BSTR(&v) = SysAllocString(L"1"); V_BSTR(&v) = SysAllocString(L"1");
hres = VarFormatNumber(&v,2,0,0,0,0,&str); 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) if (hres == S_OK)
ok(str && wcscmp(str, szResult1) == 0, "VarFormatNumber (bstr): string different\n"); ok(str && wcscmp(str, szResult1) == 0, "VarFormatNumber (bstr): string different\n");
SysFreeString(V_BSTR(&v)); SysFreeString(V_BSTR(&v));
...@@ -86,7 +86,7 @@ static void test_VarFormatNumber(void) ...@@ -86,7 +86,7 @@ static void test_VarFormatNumber(void)
V_BSTR(&v) = SysAllocString(L"-1"); V_BSTR(&v) = SysAllocString(L"-1");
hres = VarFormatNumber(&v,2,0,-1,0,0,&str); 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) if (hres == S_OK)
ok(str && wcscmp(str, L"(1.00)") == 0, "VarFormatNumber (-bstr): string different\n"); ok(str && wcscmp(str, L"(1.00)") == 0, "VarFormatNumber (-bstr): string different\n");
SysFreeString(V_BSTR(&v)); SysFreeString(V_BSTR(&v));
...@@ -384,21 +384,21 @@ static void test_VarFormat(void) ...@@ -384,21 +384,21 @@ static void test_VarFormat(void)
/* 'out' is not cleared */ /* 'out' is not cleared */
out = (BSTR)0x1; out = (BSTR)0x1;
hres = VarFormat(&in,NULL,fd,fw,flags,&out); /* Would crash if out is cleared */ 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); SysFreeString(out);
out = NULL; out = NULL;
/* VT_NULL */ /* VT_NULL */
V_VT(&in) = VT_NULL; V_VT(&in) = VT_NULL;
hres = VarFormat(&in,NULL,fd,fw,0,&out); 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"); ok(out == NULL, "expected NULL formatted string\n");
/* Invalid args */ /* Invalid args */
hres = VarFormat(&in,NULL,fd,fw,flags,NULL); 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); 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; fd = -1;
VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"",E_INVALIDARG,""); VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"",E_INVALIDARG,"");
fd = 8; fd = 8;
...@@ -480,7 +480,7 @@ static void test_VarWeekdayName(void) ...@@ -480,7 +480,7 @@ static void test_VarWeekdayName(void)
hres = VarWeekdayName(1, 0, 0, 0, NULL); hres = VarWeekdayName(1, 0, 0, 0, NULL);
ok(E_INVALIDARG == hres, 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 */ /* Check all combinations */
for (iWeekday = 1; iWeekday <= 7; ++iWeekday) for (iWeekday = 1; iWeekday <= 7; ++iWeekday)
...@@ -532,17 +532,17 @@ static void test_VarFormatFromTokens(void) ...@@ -532,17 +532,17 @@ static void test_VarFormatFromTokens(void)
lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
hres = VarTokenizeFormatString(number_fmt, buff, sizeof(buff), 1, 1, lcid, NULL); 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); 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)); ok(!wcscmp(bstr, L"690.00"), "incorrectly formatted number: %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr); SysFreeString(bstr);
lcid = MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT); lcid = MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
hres = VarTokenizeFormatString(number_fmt, buff, sizeof(buff), 1, 1, lcid, NULL); 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); 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)); ok(!wcscmp(bstr, L"6,90"), "incorrectly formatted number: %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr); SysFreeString(bstr);
...@@ -553,17 +553,17 @@ static void test_VarFormatFromTokens(void) ...@@ -553,17 +553,17 @@ static void test_VarFormatFromTokens(void)
lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
hres = VarTokenizeFormatString(date_fmt, buff, sizeof(buff), 1, 1, lcid, NULL); 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); 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)); ok(!wcscmp(bstr, L"11-12"), "incorrectly formatted date: %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr); SysFreeString(bstr);
lcid = MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT); lcid = MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
hres = VarTokenizeFormatString(date_fmt, buff, sizeof(buff), 1, 1, lcid, NULL); 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); 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)); ok(!wcscmp(bstr, L"12-11"), "incorrectly formatted date: %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr); SysFreeString(bstr);
...@@ -574,17 +574,17 @@ static void test_VarFormatFromTokens(void) ...@@ -574,17 +574,17 @@ static void test_VarFormatFromTokens(void)
lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
hres = VarTokenizeFormatString(string_fmt, buff, sizeof(buff), 1, 1, lcid, NULL); 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); 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)); ok(!wcscmp(bstr, L"1.5"), "incorrectly formatted string: %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr); SysFreeString(bstr);
lcid = MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT); lcid = MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT);
hres = VarTokenizeFormatString(string_fmt, buff, sizeof(buff), 1, 1, lcid, NULL); 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); 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)); ok(!wcscmp(bstr, L"1,5"), "incorrectly formatted string: %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr); SysFreeString(bstr);
} }
...@@ -596,32 +596,32 @@ static void test_GetAltMonthNames(void) ...@@ -596,32 +596,32 @@ static void test_GetAltMonthNames(void)
str = (void *)0xdeadbeef; str = (void *)0xdeadbeef;
hr = GetAltMonthNames(0, &str); 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); ok(str == NULL, "Got %p\n", str);
str = (void *)0xdeadbeef; str = (void *)0xdeadbeef;
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT), &str); 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); ok(str == NULL, "Got %p\n", str);
str = NULL; str = NULL;
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_ARABIC, SUBLANG_ARABIC_EGYPT), SORT_DEFAULT), &str); 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); ok(str != NULL, "Got %p\n", str);
str2 = NULL; str2 = NULL;
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_ARABIC, SUBLANG_ARABIC_EGYPT), SORT_DEFAULT), &str2); 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); ok(str2 == str, "Got %p\n", str2);
str = NULL; str = NULL;
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT), SORT_DEFAULT), &str); 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); ok(str != NULL, "Got %p\n", str);
str = NULL; str = NULL;
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_POLISH, SUBLANG_DEFAULT), SORT_DEFAULT), &str); 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); ok(str != NULL, "Got %p\n", str);
} }
...@@ -634,19 +634,19 @@ static void test_VarFormatCurrency(void) ...@@ -634,19 +634,19 @@ static void test_VarFormatCurrency(void)
V_CY(&in).int64 = 0; V_CY(&in).int64 = 0;
V_VT(&in) = VT_CY; V_VT(&in) = VT_CY;
hr = VarFormatCurrency(&in, 3, -2, -2, -2, 0, &str); 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_VT(&in) = VT_BSTR;
V_BSTR(&in) = str; V_BSTR(&in) = str;
hr = VarFormatCurrency(&in, 1, -2, -2, -2, 0, &str2); 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"); ok(lstrcmpW(str, str2), "Expected different string.\n");
SysFreeString(str2); SysFreeString(str2);
V_VT(&in) = VT_BSTR | VT_BYREF; V_VT(&in) = VT_BSTR | VT_BYREF;
V_BSTRREF(&in) = &str; V_BSTRREF(&in) = &str;
hr = VarFormatCurrency(&in, 1, -2, -2, -2, 0, &str2); 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"); ok(lstrcmpW(str, str2), "Expected different string.\n");
SysFreeString(str); SysFreeString(str);
...@@ -655,7 +655,7 @@ static void test_VarFormatCurrency(void) ...@@ -655,7 +655,7 @@ static void test_VarFormatCurrency(void)
V_VT(&in) = VT_BSTR; V_VT(&in) = VT_BSTR;
V_BSTR(&in) = SysAllocString(L"test"); V_BSTR(&in) = SysAllocString(L"test");
hr = VarFormatCurrency(&in, 1, -2, -2, -2, 0, &str2); 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); VariantClear(&in);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment