[PATCH v2 4/5] oleaut32/tests: Add some tests for marshalling public typedefs.
Zebediah Figura
z.figura12 at gmail.com
Thu Nov 1 10:20:04 CDT 2018
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/oleaut32/tests/tmarshal.c | 19 ++++++++++++++++++-
dlls/oleaut32/tests/tmarshal.idl | 6 ++++++
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/dlls/oleaut32/tests/tmarshal.c b/dlls/oleaut32/tests/tmarshal.c
index ebd0f1406d..45f5232f12 100644
--- a/dlls/oleaut32/tests/tmarshal.c
+++ b/dlls/oleaut32/tests/tmarshal.c
@@ -1314,6 +1314,14 @@ static HRESULT WINAPI Widget_mystruct_array(IWidget *iface, MYSTRUCT in[2])
return S_OK;
}
+static HRESULT WINAPI Widget_myint(IWidget *iface, myint_t val, myint_t *ptr, myint_t **ptr_ptr)
+{
+ ok(val == 123, "Got value %d.\n", val);
+ ok(*ptr == 456, "Got single ptr ref %d.\n", *ptr);
+ ok(**ptr_ptr == 789, "Got double ptr ref %d.\n", **ptr_ptr);
+ return S_OK;
+}
+
static const struct IWidgetVtbl Widget_VTable =
{
Widget_QueryInterface,
@@ -1368,6 +1376,7 @@ static const struct IWidgetVtbl Widget_VTable =
Widget_array,
Widget_variant_array,
Widget_mystruct_array,
+ Widget_myint,
};
static HRESULT WINAPI StaticWidget_QueryInterface(IStaticWidget *iface, REFIID riid, void **ppvObject)
@@ -1689,7 +1698,7 @@ static void test_marshal_basetypes(IWidget *widget, IDispatch *disp)
signed char c;
short s;
- int i;
+ int i, i2, *pi;
hyper h;
unsigned char uc;
unsigned short us;
@@ -1763,6 +1772,14 @@ static void test_marshal_basetypes(IWidget *widget, IDispatch *disp)
ok(f == (float)M_LN2, "Got float %f.\n", f);
ok(d == M_LN10, "Got double %f.\n", d);
ok(st == STATE_UNWIDGETIFIED, "Got state %u.\n", st);
+
+ /* Test marshalling of public typedefs. */
+
+ i = 456;
+ i2 = 789;
+ pi = &i2;
+ hr = IWidget_myint(widget, 123, &i, &pi);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
}
static void test_marshal_pointer(IWidget *widget, IDispatch *disp)
diff --git a/dlls/oleaut32/tests/tmarshal.idl b/dlls/oleaut32/tests/tmarshal.idl
index cce97cd977..6bf969cf09 100644
--- a/dlls/oleaut32/tests/tmarshal.idl
+++ b/dlls/oleaut32/tests/tmarshal.idl
@@ -68,6 +68,7 @@ enum IWidget_dispids
DISPID_TM_ARRAY,
DISPID_TM_VARIANT_ARRAY,
DISPID_TM_STRUCT_ARRAY,
+ DISPID_TM_TYPEDEF,
};
static const int DISPID_TM_NEG_RESTRICTED = -26;
@@ -100,6 +101,8 @@ library TestTypelib
UINT uarr[8];
} MYSTRUCT;
+ typedef [public] int myint_t;
+
coclass ApplicationObject2;
[
@@ -295,6 +298,9 @@ library TestTypelib
[id(DISPID_TM_STRUCT_ARRAY)]
HRESULT mystruct_array([in] MYSTRUCT in[2]);
+
+ [id(DISPID_TM_TYPEDEF)]
+ HRESULT myint([in] myint_t val, [in] myint_t *ptr, [in] myint_t **ptr_ptr);
}
[
--
2.19.1
More information about the wine-devel
mailing list