Commit 4a5759dc authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

oledb32: DataConvert support DBTYPE_VARIANT -> DBTYPE_R4.

parent 6864803f
......@@ -343,6 +343,11 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
case DBTYPE_UI4: hr = VarR4FromUI4(*(DWORD*)src, d); break;
case DBTYPE_I8: hr = VarR4FromI8(*(LONGLONG*)src, d); break;
case DBTYPE_UI8: hr = VarR4FromUI8(*(ULONGLONG*)src, d); break;
case DBTYPE_VARIANT:
VariantInit(&tmp);
if ((hr = VariantChangeType(&tmp, (VARIANT*)src, 0, VT_R4)) == S_OK)
*d = V_R4(&tmp);
break;
default: FIXME("Unimplemented conversion %04x -> R4\n", src_type); return E_NOTIMPL;
}
break;
......
......@@ -2580,6 +2580,15 @@ static void test_converttor4(void)
ok(hr == S_OK, "got %08x\n", hr);
ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status);
ok(dst_len == 44, "got %ld\n", dst_len);
dst_len = dst = 0x1234;
V_VT(&v) = VT_I2;
V_I2(&v) = 0x4321;
hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_R4, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0);
ok(hr == S_OK, "got %08x\n", hr);
ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status);
ok(dst_len == sizeof(dst), "got %ld\n", dst_len);
ok(dst == 0x4321, "got %f\n", dst);
}
static void test_converttor8(void)
......
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