Commit eff5223a authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

oleaut32/tests: Add a test for marshalling of floats on x86-64.

parent 55b1c430
......@@ -981,6 +981,17 @@ static HRESULT WINAPI Widget_basetypes_out(IWidget *iface, signed char *c, short
return S_OK;
}
static HRESULT WINAPI Widget_float_abi(IWidget *iface, float f, double d, int i, float f2, double d2)
{
ok(f == 1.0f, "Got float %f.\n", f);
ok(d == 2.0, "Got double %f.\n", d);
ok(i == 3, "Got int %d.\n", i);
ok(f2 == 4.0f, "Got float %f.\n", f2);
ok(d2 == 5.0, "Got double %f.\n", d2);
return S_OK;
}
static HRESULT WINAPI Widget_int_ptr(IWidget *iface, int *in, int *out, int *in_out)
{
ok(*in == 123, "Got [in] %d.\n", *in);
......@@ -1361,6 +1372,7 @@ static const struct IWidgetVtbl Widget_VTable =
Widget_Coclass,
Widget_basetypes_in,
Widget_basetypes_out,
Widget_float_abi,
Widget_int_ptr,
Widget_int_ptr_ptr,
Widget_iface_in,
......@@ -1780,6 +1792,11 @@ static void test_marshal_basetypes(IWidget *widget, IDispatch *disp)
pi = &i2;
hr = IWidget_myint(widget, 123, &i, &pi);
ok(hr == S_OK, "Got hr %#x.\n", hr);
/* Test that different float ABIs are correctly handled. */
hr = IWidget_float_abi(widget, 1.0f, 2.0, 3, 4.0f, 5.0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
}
static void test_marshal_pointer(IWidget *widget, IDispatch *disp)
......
......@@ -53,6 +53,7 @@ enum IWidget_dispids
DISPID_TM_BASETYPES_IN,
DISPID_TM_BASETYPES_OUT,
DISPID_TM_FLOAT_ABI,
DISPID_TM_INT_PTR,
DISPID_TM_INT_PTR_PTR,
DISPID_TM_IFACE_IN,
......@@ -246,6 +247,9 @@ library TestTypelib
[out] unsigned char *uc, [out] unsigned short *us, [out] unsigned int *ui,
[out] unsigned hyper *uh, [out] float *f, [out] double *d, [out] STATE *st);
[id(DISPID_TM_FLOAT_ABI)]
HRESULT float_abi([in] float f, [in] double d, [in] int i, [in] float f2, [in] double d2);
[id(DISPID_TM_INT_PTR)]
HRESULT int_ptr([in] int *in, [out] int *out, [in, out] int *in_out);
......
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