From 86147a991785c8d68531142ee60f17268eb7f3fa Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 4 Jan 2018 03:34:00 +0000 Subject: [PATCH] oledb32/tests: Add DataConvert DBTYPE_BSTR->DBTYPE_DBTIMESTAMP test. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/oledb32/tests/convert.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/oledb32/tests/convert.c b/dlls/oledb32/tests/convert.c index 6b0dd55c7f5..08256242fd7 100644 --- a/dlls/oledb32/tests/convert.c +++ b/dlls/oledb32/tests/convert.c @@ -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); -- 2.11.4.GIT