Author: akhaldi
Date: Sat Jun 3 22:34:23 2017
New Revision: 74832
URL:
http://svn.reactos.org/svn/reactos?rev=74832&view=rev
Log:
[OLEAUT32_WINETEST] Sync with Wine Staging 2.9. CORE-13362
Modified:
trunk/rostests/winetests/oleaut32/olepicture.c
trunk/rostests/winetests/oleaut32/varformat.c
trunk/rostests/winetests/oleaut32/vartest.c
trunk/rostests/winetests/oleaut32/vartype.c
Modified: trunk/rostests/winetests/oleaut32/olepicture.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/olepic…
==============================================================================
--- trunk/rostests/winetests/oleaut32/olepicture.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/oleaut32/olepicture.c [iso-8859-1] Sat Jun 3 22:34:23 2017
@@ -102,12 +102,21 @@
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] = {
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,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,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
};
@@ -1465,6 +1474,7 @@
test_pic(gifimage, sizeof(gifimage));
test_pic(jpgimage, sizeof(jpgimage));
test_pic(bmpimage, sizeof(bmpimage));
+ test_pic(bmpimage_rle8, sizeof(bmpimage_rle8));
test_pic(gif4pixel, sizeof(gif4pixel));
/* FIXME: No PNG support in Windows... */
if (0) test_pic(pngimage, sizeof(pngimage));
Modified: trunk/rostests/winetests/oleaut32/varformat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/varfor…
==============================================================================
--- trunk/rostests/winetests/oleaut32/varformat.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/oleaut32/varformat.c [iso-8859-1] Sat Jun 3 22:34:23 2017
@@ -644,6 +644,42 @@
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)
{
hOleaut32 = GetModuleHandleA("oleaut32.dll");
@@ -654,4 +690,5 @@
test_VarFormat();
test_VarWeekdayName();
test_VarFormatFromTokens();
+ test_GetAltMonthNames();
}
Modified: trunk/rostests/winetests/oleaut32/vartest.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/vartes…
==============================================================================
--- trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] Sat Jun 3 22:34:23 2017
@@ -100,6 +100,150 @@
#define R4_MIN FLT_MIN
#define R8_MAX DBL_MAX
#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
{
@@ -5611,6 +5755,7 @@
HRESULT hres;
HRESULT expected_error_num;
int cmp;
+ DummyDispatch dispatch;
CHECKPTR(VarCat);
@@ -5944,6 +6089,67 @@
VariantClear(&right);
VariantClear(&result);
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 */
V_VT(&left) = VT_BOOL;
Modified: trunk/rostests/winetests/oleaut32/vartype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/vartyp…
==============================================================================
--- trunk/rostests/winetests/oleaut32/vartype.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/oleaut32/vartype.c [iso-8859-1] Sat Jun 3 22:34:23 2017
@@ -3415,6 +3415,8 @@
SYSTEMTIME st;
OLECHAR buff[128];
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);
@@ -3538,6 +3540,11 @@
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 */
+ /* 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 */
DFS("02.01.1970"); EXPECT_MISMATCH;
DFS("02.01.1970 00:00:00"); EXPECT_MISMATCH;