oledb32: Support DB/DATE/TIME/TIMESTAMP in GetConversionSize for W/STR.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2017-06-26 00:48:29 +00:00 committed by Alexandre Julliard
parent ad79c1eed2
commit 9d11f0f962
2 changed files with 75 additions and 0 deletions

View File

@ -1409,6 +1409,9 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
case DBTYPE_I8:
case DBTYPE_UI8:
case DBTYPE_R4:
case DBTYPE_DBDATE:
case DBTYPE_DBTIMESTAMP:
case DBTYPE_DBTIME:
break;
default:
FIXME("unimplemented for %04x -> DBTYPE_STR\n", src_type);
@ -1453,6 +1456,9 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
case DBTYPE_I8:
case DBTYPE_UI8:
case DBTYPE_R4:
case DBTYPE_DBDATE:
case DBTYPE_DBTIMESTAMP:
case DBTYPE_DBTIME:
break;
default:
FIXME("unimplemented for %04x -> DBTYPE_WSTR\n", src_type);

View File

@ -2722,6 +2722,9 @@ static void test_getconversionsize(void)
LONGLONG i8 = 202;
DATE dbdate;
DECIMAL dec;
DBTIMESTAMP ts = {2013, 5, 14, 2, 4, 12, 0};
DBTIME dbtime;
DBDATE dbdate1;
/* same way as CanConvert fails here */
dst_len = 0;
@ -2992,6 +2995,39 @@ static void test_getconversionsize(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(ts);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBTIMESTAMP, DBTYPE_WSTR, &src_len, &dst_len, &ts);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBTIMESTAMP, DBTYPE_WSTR, NULL, &dst_len, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(dbtime);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBTIME, DBTYPE_WSTR, &src_len, &dst_len, &dbtime);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBTIME, DBTYPE_WSTR, NULL, &dst_len, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(dbdate1);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBDATE, DBTYPE_WSTR, &src_len, &dst_len, &dbdate1);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBDATE, DBTYPE_WSTR, NULL, &dst_len, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(i4);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_I4, DBTYPE_STR, &src_len, &dst_len, &i4);
@ -3112,6 +3148,39 @@ static void test_getconversionsize(void)
hr = IDataConvert_GetConversionSize(convert, DBTYPE_EMPTY, DBTYPE_STR, NULL, &dst_len, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(ts);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBTIMESTAMP, DBTYPE_STR, &src_len, &dst_len, &ts);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBTIMESTAMP, DBTYPE_STR, NULL, &dst_len, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(dbtime);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBTIME, DBTYPE_STR, &src_len, &dst_len, &dbtime);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBTIME, DBTYPE_STR, NULL, &dst_len, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
src_len = sizeof(dbdate1);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBDATE, DBTYPE_STR, &src_len, &dst_len, &dbdate1);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
dst_len = 0;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_DBDATE, DBTYPE_STR, NULL, &dst_len, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 110, "%ld\n", dst_len);
}
static void test_converttobytes(void)