Commit 0a5af716 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

oledb32: Implement DataConvert DBTYPE_DBDATE->DBTYPE_DBDATE.

parent cc2ac078
......@@ -131,6 +131,8 @@ static int get_length(DBTYPE type)
case DBTYPE_R8:
case DBTYPE_DATE:
return 8;
case DBTYPE_DBDATE:
return sizeof(DBDATE);
case DBTYPE_DBTIMESTAMP:
return sizeof(DBTIMESTAMP);
case DBTYPE_CY:
......@@ -413,6 +415,16 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
}
break;
}
case DBTYPE_DBDATE:
{
DBDATE *d=dst;
switch (src_type)
{
case DBTYPE_DBDATE: memcpy(d, src, sizeof(DBDATE)); hr = S_OK; break;
default: FIXME("Unimplemented conversion %04x -> DBDATE\n", src_type); return E_NOTIMPL;
}
break;
}
case DBTYPE_DBTIMESTAMP:
{
DBTIMESTAMP *d=dst;
......
......@@ -2447,6 +2447,24 @@ static void test_converttobytes(void)
ok(!memcmp(byte_src, dst, 2 ), "bytes differ\n");
}
static void test_converttodbdate(void)
{
DBLENGTH dst_len;
HRESULT hr;
DBDATE ts = {2013, 5, 14};
DBDATE dst;
DBSTATUS dst_status;
dst_len = 0;
hr = IDataConvert_DataConvert(convert, DBTYPE_DBDATE, DBTYPE_DBDATE, sizeof(ts), &dst_len, &ts, &dst, 2, 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(DBDATE), "got %ld\n", dst_len);
ok(!memcmp(&ts, &dst, sizeof(DBDATE) ), "bytes differ\n");
}
static void test_converttovar(void)
{
static WCHAR strW[] = {'t','e','s','t',0};
......@@ -2601,6 +2619,7 @@ START_TEST(convert)
test_converttoui8();
test_converttovar();
test_converttobytes();
test_converttodbdate();
test_getconversionsize();
IDataConvert_Release(convert);
......
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