Alistair Leslie-Hughes : oledb32/tests: Add DataConvert DBTYPE_BSTR-> DBTYPE_DBTIMESTAMP test.
Alexandre Julliard
julliard at winehq.org
Thu Jan 4 17:03:21 CST 2018
Module: wine
Branch: master
Commit: 86147a991785c8d68531142ee60f17268eb7f3fa
URL: https://source.winehq.org/git/wine.git/?a=commit;h=86147a991785c8d68531142ee60f17268eb7f3fa
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Thu Jan 4 03:34:00 2018 +0000
oledb32/tests: Add DataConvert DBTYPE_BSTR->DBTYPE_DBTIMESTAMP test.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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);
More information about the wine-cvs
mailing list