From 0d1b4239fde4412f80c228a4c1a96c641556f466 Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Wed, 5 May 2004 19:00:21 +0000 Subject: [PATCH] Trace the system and user locales upon startup. Print the returned string if VarDateChangeTypeEx fails. --- dlls/oleaut32/tests/vartype.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/oleaut32/tests/vartype.c b/dlls/oleaut32/tests/vartype.c index 62dd89038d3..012904749a4 100644 --- a/dlls/oleaut32/tests/vartype.c +++ b/dlls/oleaut32/tests/vartype.c @@ -3336,11 +3336,18 @@ static void test_VarDateCopy(void) 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); \ ok(hres == S_OK && V_VT(&vDst) == VT_BSTR && \ V_BSTR(&vDst) && !strcmpW(V_BSTR(&vDst), str), \ - "hres=0x%lX, type=%d (should be VT_BSTR), *bstr='%c'\n", \ - hres, V_VT(&vDst), V_BSTR(&vDst) ? *V_BSTR(&vDst) : '?') + "hres=0x%lX, type=%d (should be VT_BSTR), *bstr=%s\n", \ + hres, V_VT(&vDst), V_BSTR(&vDst) ? wtoascii(V_BSTR(&vDst)) : "?") static void test_VarDateChangeTypeEx(void) { @@ -5238,6 +5245,9 @@ START_TEST(vartype) if (!hOleaut32) return; + trace("LCID's: System=0x%08lx, User=0x%08lx\n", GetSystemDefaultLCID(), + GetUserDefaultLCID()); + test_VarI1FromI2(); test_VarI1FromI4(); test_VarI1FromI8();