[PATCH 4/5] oleaut32/tests: Add some tests for marshalling public typedefs.

Zebediah Figura z.figura12 at gmail.com
Wed Oct 31 20:21:08 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 7cbd95f37c..96663d177b 100644
--- a/dlls/oleaut32/tests/tmarshal.c
+++ b/dlls/oleaut32/tests/tmarshal.c
@@ -1328,6 +1328,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,
@@ -1383,6 +1391,7 @@ static const struct IWidgetVtbl Widget_VTable =
     Widget_array_ptr,
     Widget_variant_array,
     Widget_mystruct_array,
+    Widget_myint,
 };
 
 static HRESULT WINAPI StaticWidget_QueryInterface(IStaticWidget *iface, REFIID riid, void **ppvObject)
@@ -1704,7 +1713,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;
@@ -1778,6 +1787,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 a3fe7e2cb5..a8a947da9f 100644
--- a/dlls/oleaut32/tests/tmarshal.idl
+++ b/dlls/oleaut32/tests/tmarshal.idl
@@ -69,6 +69,7 @@ enum IWidget_dispids
     DISPID_TM_ARRAY_PTR,
     DISPID_TM_VARIANT_ARRAY,
     DISPID_TM_STRUCT_ARRAY,
+    DISPID_TM_TYPEDEF,
 };
 
 static const int DISPID_TM_NEG_RESTRICTED = -26;
@@ -101,6 +102,8 @@ library TestTypelib
         UINT uarr[8];
     } MYSTRUCT;
 
+    typedef [public] int myint_t;
+
     coclass ApplicationObject2;
 
     [
@@ -299,6 +302,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