Commit 7198499d authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

oleaut32/tests: Add test for VarBstrFromI4.

parent 32c6e823
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment