Commit 86147a99 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

oledb32/tests: Add DataConvert DBTYPE_BSTR->DBTYPE_DBTIMESTAMP test.

parent 9c95bfcc
......@@ -3608,7 +3608,10 @@ static void test_converttovar(void)
static void test_converttotimestamp(void)
{
static const WCHAR strW[] = {'2','0','1','3','-','0','5','-','1','4',' ','0','2',':','0','4',':','1','2',0};
static const WCHAR strFullW[] = {'2','0','1','3','-','0','5','-','1','4',' ','0','2',':','0','4',':','1','2',
'.','0','1','7','0','0','0','0','0','0',0};
DBTIMESTAMP ts = {2013, 5, 14, 2, 4, 12, 0};
DBTIMESTAMP ts1 = {2013, 5, 14, 2, 4, 12, 17000000};
DBTIMESTAMP dst;
DBSTATUS dst_status;
DBLENGTH dst_len;
......@@ -3635,6 +3638,15 @@ static void test_converttotimestamp(void)
ok(!memcmp(&ts, &dst, sizeof(ts)), "Wrong timestamp\n");
SysFreeString(bstr);
bstr = SysAllocString(strFullW);
dst_len = 0x1234;
hr = IDataConvert_DataConvert(convert, DBTYPE_BSTR, DBTYPE_DBTIMESTAMP, 0, &dst_len, &bstr, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0);
todo_wine ok(hr == S_OK, "got %08x\n", hr);
todo_wine ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status);
todo_wine ok(dst_len == sizeof(dst), "got %ld\n", dst_len);
todo_wine ok(!memcmp(&ts1, &dst, sizeof(ts1)), "Wrong timestamp\n");
SysFreeString(bstr);
V_VT(&var) = VT_NULL;
dst_len = 77;
hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_DBTIMESTAMP, sizeof(var), &dst_len, &var, &dst, 2, 0, &dst_status, 0, 0, 0);
......
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