Commit 368cff7a authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

oledb32: Implement DataConvert DBTYPE_I2 -> VARIANT.

parent cdcea0e8
......@@ -878,6 +878,11 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
V_BOOL(v) = *(VARIANT_BOOL*)src;
hr = S_OK;
break;
case DBTYPE_I2:
V_VT(v) = VT_I2;
V_I2(v) = *(signed short*)src;
hr = S_OK;
break;
case DBTYPE_I4:
V_VT(v) = VT_I4;
V_I4(v) = *(signed int*)src;
......
......@@ -2666,6 +2666,7 @@ static void test_converttovar(void)
CY cy, cy2;
DATE date;
INT i4;
signed short i2;
LARGE_INTEGER i8;
VARIANT_BOOL boolean = VARIANT_TRUE;
FLOAT fvalue = 543.21f;
......@@ -2746,6 +2747,17 @@ static void test_converttovar(void)
V_VT(&dst) = VT_EMPTY;
dst_len = 0;
dst_status = DBSTATUS_S_DEFAULT;
i2 = 123;
hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_VARIANT, sizeof(i2), &dst_len, &i2, &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(V_VT(&dst) == VT_I2, "got %d\n", V_VT(&dst));
ok(V_I2(&dst) == 123, "got %d\n", V_I2(&dst));
V_VT(&dst) = VT_EMPTY;
dst_len = 0;
dst_status = DBSTATUS_S_DEFAULT;
date = 123.123;
hr = IDataConvert_DataConvert(convert, DBTYPE_DATE, DBTYPE_VARIANT, sizeof(date), &dst_len, &date, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0);
ok(hr == S_OK, "got %08x\n", hr);
......
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