oleaut32/tests: Add test for VarBstrFromI4.

Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Daniel Lehman 2018-07-24 15:41:18 -07:00 committed by Alexandre Julliard
parent 32c6e823bc
commit 7198499dd0
1 changed files with 31 additions and 0 deletions

View File

@ -4540,6 +4540,36 @@ static void test_VarBoolChangeTypeEx(void)
* BSTR
*/
static void test_VarBstrFromI4(void)
{
static const WCHAR int_min[] = { '-','2','1','4','7','4','8','3','6','4','8','\0' };
static const WCHAR minus_42[] = { '-','4','2','\0' };
BSTR bstr = NULL;
HRESULT hres;
LONG value;
LCID lcid;
lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
value = -2147483648;
hres = VarBstrFromI4(value, lcid, LOCALE_NOUSEROVERRIDE, &bstr);
ok(hres == S_OK, "got hres 0x%08x\n", hres);
if (bstr)
{
todo_wine ok(memcmp(bstr, int_min, sizeof(int_min)) == 0, "string different\n");
SysFreeString(bstr);
}
value = -42;
hres = VarBstrFromI4(value, lcid, LOCALE_NOUSEROVERRIDE, &bstr);
ok(hres == S_OK, "got hres 0x%08x\n", hres);
if (bstr)
{
ok(memcmp(bstr, minus_42, sizeof(minus_42)) == 0, "string different\n");
SysFreeString(bstr);
}
}
static void test_VarBstrFromR4(void)
{
static const WCHAR szNative[] = { '6','5','4','3','2','2','.','3','\0' };
@ -6347,6 +6377,7 @@ START_TEST(vartype)
test_VarBoolCopy();
test_VarBoolChangeTypeEx();
test_VarBstrFromI4();
test_VarBstrFromR4();
test_VarBstrFromDate();
test_VarBstrFromCy();