mirror of
https://github.com/reactos/reactos.git
synced 2024-08-04 02:20:54 +00:00
[OLEAUT32_WINETEST] Sync with Wine Staging 2.9. CORE-13362
svn path=/trunk/; revision=74832
This commit is contained in:
parent
09236d66df
commit
2f788a0264
|
@ -102,7 +102,7 @@ static const unsigned char pngimage[285] = {
|
||||||
0xe7,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
|
0xe7,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 1x1 pixel bmp */
|
/* 1bpp BI_RGB 1x1 pixel bmp */
|
||||||
static const unsigned char bmpimage[66] = {
|
static const unsigned char bmpimage[66] = {
|
||||||
0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
|
0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
|
||||||
0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,
|
0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,
|
||||||
|
@ -111,6 +111,15 @@ static const unsigned char bmpimage[66] = {
|
||||||
0x00,0x00
|
0x00,0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* 8bpp BI_RLE8 1x1 pixel bmp */
|
||||||
|
static const unsigned char bmpimage_rle8[] = {
|
||||||
|
0x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
|
||||||
|
0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x08,0x00,0x01,0x00,
|
||||||
|
0x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00,
|
||||||
|
0x00,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0x00,0x01,
|
||||||
|
0x00,0x00
|
||||||
|
};
|
||||||
|
|
||||||
/* 2x2 pixel gif */
|
/* 2x2 pixel gif */
|
||||||
static const unsigned char gif4pixel[42] = {
|
static const unsigned char gif4pixel[42] = {
|
||||||
0x47,0x49,0x46,0x38,0x37,0x61,0x02,0x00,0x02,0x00,0xa1,0x00,0x00,0x00,0x00,0x00,
|
0x47,0x49,0x46,0x38,0x37,0x61,0x02,0x00,0x02,0x00,0xa1,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
@ -1465,6 +1474,7 @@ START_TEST(olepicture)
|
||||||
test_pic(gifimage, sizeof(gifimage));
|
test_pic(gifimage, sizeof(gifimage));
|
||||||
test_pic(jpgimage, sizeof(jpgimage));
|
test_pic(jpgimage, sizeof(jpgimage));
|
||||||
test_pic(bmpimage, sizeof(bmpimage));
|
test_pic(bmpimage, sizeof(bmpimage));
|
||||||
|
test_pic(bmpimage_rle8, sizeof(bmpimage_rle8));
|
||||||
test_pic(gif4pixel, sizeof(gif4pixel));
|
test_pic(gif4pixel, sizeof(gif4pixel));
|
||||||
/* FIXME: No PNG support in Windows... */
|
/* FIXME: No PNG support in Windows... */
|
||||||
if (0) test_pic(pngimage, sizeof(pngimage));
|
if (0) test_pic(pngimage, sizeof(pngimage));
|
||||||
|
|
|
@ -644,6 +644,42 @@ static void test_VarFormatFromTokens(void)
|
||||||
SysFreeString(bstr);
|
SysFreeString(bstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_GetAltMonthNames(void)
|
||||||
|
{
|
||||||
|
LPOLESTR *str, *str2;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
str = (void *)0xdeadbeef;
|
||||||
|
hr = GetAltMonthNames(0, &str);
|
||||||
|
ok(hr == S_OK, "Unexpected return value %08x\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(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(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(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(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(str != NULL, "Got %p\n", str);
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(varformat)
|
START_TEST(varformat)
|
||||||
{
|
{
|
||||||
hOleaut32 = GetModuleHandleA("oleaut32.dll");
|
hOleaut32 = GetModuleHandleA("oleaut32.dll");
|
||||||
|
@ -654,4 +690,5 @@ START_TEST(varformat)
|
||||||
test_VarFormat();
|
test_VarFormat();
|
||||||
test_VarWeekdayName();
|
test_VarWeekdayName();
|
||||||
test_VarFormatFromTokens();
|
test_VarFormatFromTokens();
|
||||||
|
test_GetAltMonthNames();
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,150 @@ static BOOL has_i8;
|
||||||
#define R8_MAX DBL_MAX
|
#define R8_MAX DBL_MAX
|
||||||
#define R8_MIN DBL_MIN
|
#define R8_MIN DBL_MIN
|
||||||
|
|
||||||
|
#define DEFINE_EXPECT(func) \
|
||||||
|
static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
|
||||||
|
|
||||||
|
#define SET_EXPECT(func) \
|
||||||
|
do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)
|
||||||
|
|
||||||
|
#define CHECK_EXPECT2(func) \
|
||||||
|
do { \
|
||||||
|
ok(expect_ ##func, "unexpected call " #func "\n"); \
|
||||||
|
called_ ## func = TRUE; \
|
||||||
|
}while(0)
|
||||||
|
|
||||||
|
#define CHECK_EXPECT(func) \
|
||||||
|
do { \
|
||||||
|
CHECK_EXPECT2(func); \
|
||||||
|
expect_ ## func = FALSE; \
|
||||||
|
}while(0)
|
||||||
|
|
||||||
|
#define CHECK_CALLED(func) \
|
||||||
|
do { \
|
||||||
|
ok(called_ ## func, "expected " #func "\n"); \
|
||||||
|
expect_ ## func = called_ ## func = FALSE; \
|
||||||
|
}while(0)
|
||||||
|
|
||||||
|
DEFINE_EXPECT(dispatch_invoke);
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
IDispatch IDispatch_iface;
|
||||||
|
VARTYPE vt;
|
||||||
|
HRESULT result;
|
||||||
|
} DummyDispatch;
|
||||||
|
|
||||||
|
static inline DummyDispatch *impl_from_IDispatch(IDispatch *iface)
|
||||||
|
{
|
||||||
|
return CONTAINING_RECORD(iface, DummyDispatch, IDispatch_iface);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI DummyDispatch_AddRef(IDispatch *iface)
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG WINAPI DummyDispatch_Release(IDispatch *iface)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI DummyDispatch_QueryInterface(IDispatch *iface,
|
||||||
|
REFIID riid,
|
||||||
|
void** ppvObject)
|
||||||
|
{
|
||||||
|
*ppvObject = NULL;
|
||||||
|
|
||||||
|
if (IsEqualIID(riid, &IID_IDispatch) ||
|
||||||
|
IsEqualIID(riid, &IID_IUnknown))
|
||||||
|
{
|
||||||
|
*ppvObject = iface;
|
||||||
|
IDispatch_AddRef(iface);
|
||||||
|
}
|
||||||
|
|
||||||
|
return *ppvObject ? S_OK : E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI DummyDispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo)
|
||||||
|
{
|
||||||
|
ok(0, "Unexpected call\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI DummyDispatch_GetTypeInfo(IDispatch *iface, UINT tinfo, LCID lcid, ITypeInfo **ti)
|
||||||
|
{
|
||||||
|
ok(0, "Unexpected call\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI DummyDispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *names,
|
||||||
|
UINT cnames, LCID lcid, DISPID *dispid)
|
||||||
|
{
|
||||||
|
ok(0, "Unexpected call\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI DummyDispatch_Invoke(IDispatch *iface,
|
||||||
|
DISPID dispid, REFIID riid,
|
||||||
|
LCID lcid, WORD wFlags,
|
||||||
|
DISPPARAMS *params,
|
||||||
|
VARIANT *res,
|
||||||
|
EXCEPINFO *ei,
|
||||||
|
UINT *arg_err)
|
||||||
|
{
|
||||||
|
DummyDispatch *This = impl_from_IDispatch(iface);
|
||||||
|
|
||||||
|
CHECK_EXPECT(dispatch_invoke);
|
||||||
|
|
||||||
|
ok(dispid == DISPID_VALUE, "got dispid %d\n", dispid);
|
||||||
|
ok(IsEqualIID(riid, &IID_NULL), "go riid %s\n", wine_dbgstr_guid(riid));
|
||||||
|
ok(wFlags == DISPATCH_PROPERTYGET, "Flags wrong\n");
|
||||||
|
|
||||||
|
ok(params->rgvarg == NULL, "got %p\n", params->rgvarg);
|
||||||
|
ok(params->rgdispidNamedArgs == NULL, "got %p\n", params->rgdispidNamedArgs);
|
||||||
|
ok(params->cArgs == 0, "got %d\n", params->cArgs);
|
||||||
|
ok(params->cNamedArgs == 0, "got %d\n", params->cNamedArgs);
|
||||||
|
|
||||||
|
ok(res != NULL, "got %p\n", res);
|
||||||
|
ok(V_VT(res) == VT_EMPTY, "got %d\n", V_VT(res));
|
||||||
|
ok(ei == NULL, "got %p\n", ei);
|
||||||
|
ok(arg_err == NULL, "got %p\n", arg_err);
|
||||||
|
|
||||||
|
if (FAILED(This->result))
|
||||||
|
return This->result;
|
||||||
|
|
||||||
|
V_VT(res) = This->vt;
|
||||||
|
if (This->vt == VT_UI1)
|
||||||
|
V_UI1(res) = 34;
|
||||||
|
else if (This->vt == VT_NULL)
|
||||||
|
{
|
||||||
|
V_VT(res) = VT_NULL;
|
||||||
|
V_BSTR(res) = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
memset(res, 0, sizeof(*res));
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const IDispatchVtbl DummyDispatch_VTable =
|
||||||
|
{
|
||||||
|
DummyDispatch_QueryInterface,
|
||||||
|
DummyDispatch_AddRef,
|
||||||
|
DummyDispatch_Release,
|
||||||
|
DummyDispatch_GetTypeInfoCount,
|
||||||
|
DummyDispatch_GetTypeInfo,
|
||||||
|
DummyDispatch_GetIDsOfNames,
|
||||||
|
DummyDispatch_Invoke
|
||||||
|
};
|
||||||
|
|
||||||
|
static void init_test_dispatch(VARTYPE vt, DummyDispatch *dispatch)
|
||||||
|
{
|
||||||
|
dispatch->IDispatch_iface.lpVtbl = &DummyDispatch_VTable;
|
||||||
|
dispatch->vt = vt;
|
||||||
|
dispatch->result = S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
typedef struct IRecordInfoImpl
|
typedef struct IRecordInfoImpl
|
||||||
{
|
{
|
||||||
IRecordInfo IRecordInfo_iface;
|
IRecordInfo IRecordInfo_iface;
|
||||||
|
@ -5611,6 +5755,7 @@ static void test_VarCat(void)
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
HRESULT expected_error_num;
|
HRESULT expected_error_num;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
DummyDispatch dispatch;
|
||||||
|
|
||||||
CHECKPTR(VarCat);
|
CHECKPTR(VarCat);
|
||||||
|
|
||||||
|
@ -5945,6 +6090,67 @@ static void test_VarCat(void)
|
||||||
VariantClear(&result);
|
VariantClear(&result);
|
||||||
VariantClear(&expected);
|
VariantClear(&expected);
|
||||||
|
|
||||||
|
/* Dispatch conversion */
|
||||||
|
init_test_dispatch(VT_NULL, &dispatch);
|
||||||
|
V_VT(&left) = VT_DISPATCH;
|
||||||
|
V_DISPATCH(&left) = &dispatch.IDispatch_iface;
|
||||||
|
|
||||||
|
SET_EXPECT(dispatch_invoke);
|
||||||
|
hres = VarCat(&left, &right, &result);
|
||||||
|
todo_wine ok(hres == S_OK, "got 0x%08x\n", hres);
|
||||||
|
ok(V_VT(&result) == VT_BSTR, "got %d\n", V_VT(&result));
|
||||||
|
ok(SysStringLen(V_BSTR(&result)) == 0, "got %d\n", SysStringLen(V_BSTR(&result)));
|
||||||
|
CHECK_CALLED(dispatch_invoke);
|
||||||
|
|
||||||
|
VariantClear(&left);
|
||||||
|
VariantClear(&right);
|
||||||
|
VariantClear(&result);
|
||||||
|
|
||||||
|
init_test_dispatch(VT_NULL, &dispatch);
|
||||||
|
V_VT(&right) = VT_DISPATCH;
|
||||||
|
V_DISPATCH(&right) = &dispatch.IDispatch_iface;
|
||||||
|
|
||||||
|
SET_EXPECT(dispatch_invoke);
|
||||||
|
hres = VarCat(&left, &right, &result);
|
||||||
|
todo_wine ok(hres == S_OK, "got 0x%08x\n", hres);
|
||||||
|
ok(V_VT(&result) == VT_BSTR, "got %d\n", V_VT(&result));
|
||||||
|
ok(SysStringLen(V_BSTR(&result)) == 0, "got %d\n", SysStringLen(V_BSTR(&result)));
|
||||||
|
CHECK_CALLED(dispatch_invoke);
|
||||||
|
|
||||||
|
VariantClear(&left);
|
||||||
|
VariantClear(&right);
|
||||||
|
VariantClear(&result);
|
||||||
|
|
||||||
|
init_test_dispatch(VT_UI1, &dispatch);
|
||||||
|
V_VT(&right) = VT_DISPATCH;
|
||||||
|
V_DISPATCH(&right) = &dispatch.IDispatch_iface;
|
||||||
|
|
||||||
|
V_VT(&left) = VT_BSTR;
|
||||||
|
V_BSTR(&left) = SysAllocString(sz12);
|
||||||
|
SET_EXPECT(dispatch_invoke);
|
||||||
|
hres = pVarCat(&left,&right,&result);
|
||||||
|
ok(hres == S_OK, "VarCat failed with error 0x%08x\n", hres);
|
||||||
|
CHECK_CALLED(dispatch_invoke);
|
||||||
|
ok(!strcmp_wa(V_BSTR(&result), "1234"), "got %s\n", wine_dbgstr_w(V_BSTR(&result)));
|
||||||
|
|
||||||
|
VariantClear(&left);
|
||||||
|
VariantClear(&right);
|
||||||
|
VariantClear(&result);
|
||||||
|
|
||||||
|
init_test_dispatch(VT_NULL, &dispatch);
|
||||||
|
dispatch.result = E_OUTOFMEMORY;
|
||||||
|
V_VT(&right) = VT_DISPATCH;
|
||||||
|
V_DISPATCH(&right) = &dispatch.IDispatch_iface;
|
||||||
|
|
||||||
|
SET_EXPECT(dispatch_invoke);
|
||||||
|
hres = VarCat(&left, &right, &result);
|
||||||
|
todo_wine ok(hres == E_OUTOFMEMORY, "got 0x%08x\n", hres);
|
||||||
|
CHECK_CALLED(dispatch_invoke);
|
||||||
|
|
||||||
|
VariantClear(&left);
|
||||||
|
VariantClear(&right);
|
||||||
|
VariantClear(&result);
|
||||||
|
|
||||||
/* Test boolean conversion */
|
/* Test boolean conversion */
|
||||||
V_VT(&left) = VT_BOOL;
|
V_VT(&left) = VT_BOOL;
|
||||||
V_BOOL(&left) = VARIANT_TRUE;
|
V_BOOL(&left) = VARIANT_TRUE;
|
||||||
|
|
|
@ -3415,6 +3415,8 @@ static void test_VarDateFromStr(void)
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
OLECHAR buff[128];
|
OLECHAR buff[128];
|
||||||
size_t i;
|
size_t i;
|
||||||
|
OLECHAR with_ideographic_spaceW[] = { '6','/','3','0','/','2','0','1','1',0x3000,
|
||||||
|
'1',':','2','0',':','3','4',0 };
|
||||||
|
|
||||||
lcid = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT);
|
lcid = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT);
|
||||||
|
|
||||||
|
@ -3538,6 +3540,11 @@ static void test_VarDateFromStr(void)
|
||||||
DFS("6/30/2011 01:20:34 PM"); EXPECT_DBL(40724.55594907407);
|
DFS("6/30/2011 01:20:34 PM"); EXPECT_DBL(40724.55594907407);
|
||||||
/* Native fails "1999 January 3, 9AM". I consider that a bug in native */
|
/* Native fails "1999 January 3, 9AM". I consider that a bug in native */
|
||||||
|
|
||||||
|
/* test a data with ideographic space */
|
||||||
|
out = 0.0;
|
||||||
|
hres = pVarDateFromStr(with_ideographic_spaceW, lcid, LOCALE_NOUSEROVERRIDE, &out);
|
||||||
|
EXPECT_DBL(40724.05594907407);
|
||||||
|
|
||||||
/* test a non-english data string */
|
/* test a non-english data string */
|
||||||
DFS("02.01.1970"); EXPECT_MISMATCH;
|
DFS("02.01.1970"); EXPECT_MISMATCH;
|
||||||
DFS("02.01.1970 00:00:00"); EXPECT_MISMATCH;
|
DFS("02.01.1970 00:00:00"); EXPECT_MISMATCH;
|
||||||
|
|
Loading…
Reference in a new issue