Trace the system and user locales upon startup.

Print the returned string if VarDateChangeTypeEx fails.
This commit is contained in:
Jon Griffiths 2004-05-05 19:00:21 +00:00 committed by Alexandre Julliard
parent 7be996e9b7
commit 0d1b4239fd
1 changed files with 12 additions and 2 deletions

View File

@ -3336,11 +3336,18 @@ static void test_VarDateCopy(void)
V_DATEREF(&vDst), "%16.16g"); V_DATEREF(&vDst), "%16.16g");
} }
static const char* wtoascii(LPWSTR lpszIn)
{
static char buff[256];
WideCharToMultiByte(CP_ACP, 0, lpszIn, -1, buff, sizeof(buff), NULL, NULL);
return buff;
}
#define DATE_STR(flags, str) hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, flags, VT_BSTR); \ #define DATE_STR(flags, str) hres = VariantChangeTypeEx(&vDst, &vSrc, lcid, flags, VT_BSTR); \
ok(hres == S_OK && V_VT(&vDst) == VT_BSTR && \ ok(hres == S_OK && V_VT(&vDst) == VT_BSTR && \
V_BSTR(&vDst) && !strcmpW(V_BSTR(&vDst), str), \ V_BSTR(&vDst) && !strcmpW(V_BSTR(&vDst), str), \
"hres=0x%lX, type=%d (should be VT_BSTR), *bstr='%c'\n", \ "hres=0x%lX, type=%d (should be VT_BSTR), *bstr=%s\n", \
hres, V_VT(&vDst), V_BSTR(&vDst) ? *V_BSTR(&vDst) : '?') hres, V_VT(&vDst), V_BSTR(&vDst) ? wtoascii(V_BSTR(&vDst)) : "?")
static void test_VarDateChangeTypeEx(void) static void test_VarDateChangeTypeEx(void)
{ {
@ -5238,6 +5245,9 @@ START_TEST(vartype)
if (!hOleaut32) if (!hOleaut32)
return; return;
trace("LCID's: System=0x%08lx, User=0x%08lx\n", GetSystemDefaultLCID(),
GetUserDefaultLCID());
test_VarI1FromI2(); test_VarI1FromI2();
test_VarI1FromI4(); test_VarI1FromI4();
test_VarI1FromI8(); test_VarI1FromI8();