[PATCH] oledb32/tests: Add DataConvert DBTYPE_BSTR->DBTYPE_DBTIMESTAMP test
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Wed Jan 3 21:34:00 CST 2018
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
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 6b0dd55..0825624 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);
--
1.9.1
More information about the wine-devel
mailing list