"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dlls/oleaut32/tests/varformat.c" between
wine-6.0.tar.xz and wine-6.0.1.tar.xz

About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs.

varformat.c  (wine-6.0.tar.xz):varformat.c  (wine-6.0.1.tar.xz)
skipping to change at line 40 skipping to change at line 40
#include "wine/test.h" #include "wine/test.h"
#include "winuser.h" #include "winuser.h"
#include "wingdi.h" #include "wingdi.h"
#include "winnls.h" #include "winnls.h"
#include "winerror.h" #include "winerror.h"
#include "winnt.h" #include "winnt.h"
#include "wtypes.h" #include "wtypes.h"
#include "oleauto.h" #include "oleauto.h"
static HMODULE hOleaut32;
static HRESULT (WINAPI *pVarFormatNumber)(LPVARIANT,int,int,int,int,ULONG,BSTR*)
;
static HRESULT (WINAPI *pVarFormat)(LPVARIANT,LPOLESTR,int,int,ULONG,BSTR*);
static HRESULT (WINAPI *pVarWeekdayName)(int,int,int,ULONG,BSTR*);
/* Has I8/UI8 data type? */
static BOOL has_i8;
/* Get a conversion function ptr, return if function not available */
#define CHECKPTR(func) p##func = (void*)GetProcAddress(hOleaut32, #func); \
if (!p##func) { win_skip("function " # func " not available, not testing it\n"
); return; }
#define FMT_NUMBER(vt,val) \ #define FMT_NUMBER(vt,val) \
VariantInit(&v); V_VT(&v) = vt; val(&v) = 1; \ VariantInit(&v); V_VT(&v) = vt; val(&v) = 1; \
hres = pVarFormatNumber(&v,2,0,0,0,0,&str); \ hres = VarFormatNumber(&v,2,0,0,0,0,&str); \
ok(hres == S_OK, "VarFormatNumber (vt %d): returned %8x\n", vt, hres); \ ok(hres == S_OK, "VarFormatNumber (vt %d): returned %8x\n", vt, hres); \
if (hres == S_OK) { \ if (hres == S_OK) { \
ok(str && wcscmp(str,szResult1) == 0, \ ok(str && wcscmp(str,szResult1) == 0, \
"VarFormatNumber (vt %d): string different\n", vt); \ "VarFormatNumber (vt %d): string different\n", vt); \
SysFreeString(str); \ SysFreeString(str); \
} }
static void test_VarFormatNumber(void) static void test_VarFormatNumber(void)
{ {
static const WCHAR szSrc1[] = { '1','\0' }; static const WCHAR szSrc1[] = { '1','\0' };
static const WCHAR szResult1[] = { '1','.','0','0','\0' }; static const WCHAR szResult1[] = { '1','.','0','0','\0' };
static const WCHAR szSrc2[] = { '-','1','\0' }; static const WCHAR szSrc2[] = { '-','1','\0' };
static const WCHAR szResult2[] = { '(','1','.','0','0',')','\0' }; static const WCHAR szResult2[] = { '(','1','.','0','0',')','\0' };
char buff[8]; char buff[8];
HRESULT hres; HRESULT hres;
VARIANT v; VARIANT v;
BSTR str = NULL; BSTR str = NULL;
CHECKPTR(VarFormatNumber);
GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, buff, ARRAY_SIZE(buff)); GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, buff, ARRAY_SIZE(buff));
if (buff[0] != '.' || buff[1]) if (buff[0] != '.' || buff[1])
{ {
skip("Skipping VarFormatNumber tests as decimal separator is '%s'\n", buff); skip("Skipping VarFormatNumber tests as decimal separator is '%s'\n", buff);
return; return;
} }
FMT_NUMBER(VT_I1, V_I1); FMT_NUMBER(VT_I1, V_I1);
FMT_NUMBER(VT_UI1, V_UI1); FMT_NUMBER(VT_UI1, V_UI1);
FMT_NUMBER(VT_I2, V_I2); FMT_NUMBER(VT_I2, V_I2);
FMT_NUMBER(VT_UI2, V_UI2); FMT_NUMBER(VT_UI2, V_UI2);
FMT_NUMBER(VT_I4, V_I4); FMT_NUMBER(VT_I4, V_I4);
FMT_NUMBER(VT_UI4, V_UI4); FMT_NUMBER(VT_UI4, V_UI4);
if (has_i8) FMT_NUMBER(VT_I8, V_I8);
{ FMT_NUMBER(VT_UI8, V_UI8);
FMT_NUMBER(VT_I8, V_I8);
FMT_NUMBER(VT_UI8, V_UI8);
}
FMT_NUMBER(VT_R4, V_R4); FMT_NUMBER(VT_R4, V_R4);
FMT_NUMBER(VT_R8, V_R8); FMT_NUMBER(VT_R8, V_R8);
FMT_NUMBER(VT_BOOL, V_BOOL); FMT_NUMBER(VT_BOOL, V_BOOL);
V_VT(&v) = VT_BSTR; V_VT(&v) = VT_BSTR;
V_BSTR(&v) = SysAllocString(szSrc1); V_BSTR(&v) = SysAllocString(szSrc1);
hres = pVarFormatNumber(&v,2,0,0,0,0,&str); hres = VarFormatNumber(&v,2,0,0,0,0,&str);
ok(hres == S_OK, "VarFormatNumber (bstr): returned %8x\n", hres); ok(hres == S_OK, "VarFormatNumber (bstr): returned %8x\n", hres);
if (hres == S_OK) if (hres == S_OK)
ok(str && wcscmp(str, szResult1) == 0, "VarFormatNumber (bstr): string diffe rent\n"); ok(str && wcscmp(str, szResult1) == 0, "VarFormatNumber (bstr): string diffe rent\n");
SysFreeString(V_BSTR(&v)); SysFreeString(V_BSTR(&v));
SysFreeString(str); SysFreeString(str);
V_BSTR(&v) = SysAllocString(szSrc2); V_BSTR(&v) = SysAllocString(szSrc2);
hres = pVarFormatNumber(&v,2,0,-1,0,0,&str); hres = VarFormatNumber(&v,2,0,-1,0,0,&str);
ok(hres == S_OK, "VarFormatNumber (bstr): returned %8x\n", hres); ok(hres == S_OK, "VarFormatNumber (bstr): returned %8x\n", hres);
if (hres == S_OK) if (hres == S_OK)
ok(str && wcscmp(str, szResult2) == 0, "VarFormatNumber (-bstr): string diff erent\n"); ok(str && wcscmp(str, szResult2) == 0, "VarFormatNumber (-bstr): string diff erent\n");
SysFreeString(V_BSTR(&v)); SysFreeString(V_BSTR(&v));
SysFreeString(str); SysFreeString(str);
} }
#define SIGNED_VTBITS (VTBIT_I1|VTBIT_I2|VTBIT_I4|VTBIT_I8|VTBIT_R4|VTBIT_R8) #define SIGNED_VTBITS (VTBIT_I1|VTBIT_I2|VTBIT_I4|VTBIT_I8|VTBIT_R4|VTBIT_R8)
static const char *szVarFmtFail = "VT %d|0x%04x Format %s: expected 0x%08x, '%s' , got 0x%08x, '%s'\n"; static const char *szVarFmtFail = "VT %d|0x%04x Format %s: expected 0x%08x, '%s' , got 0x%08x, '%s'\n";
#define VARFMT(vt,v,val,fmt,ret,str) do { \ #define VARFMT(vt,v,val,fmt,ret,str) do { \
out = NULL; \ out = NULL; \
V_VT(&in) = (vt); v(&in) = val; \ V_VT(&in) = (vt); v(&in) = val; \
if (fmt) MultiByteToWideChar(CP_ACP, 0, fmt, -1, buffW, ARRAY_SIZE(buffW)); \ if (fmt) MultiByteToWideChar(CP_ACP, 0, fmt, -1, buffW, ARRAY_SIZE(buffW)); \
hres = pVarFormat(&in,fmt ? buffW : NULL,fd,fw,flags,&out); \ hres = VarFormat(&in,fmt ? buffW : NULL,fd,fw,flags,&out); \
if (SUCCEEDED(hres)) WideCharToMultiByte(CP_ACP, 0, out, -1, buff, sizeof(buff ),0,0); \ if (SUCCEEDED(hres)) WideCharToMultiByte(CP_ACP, 0, out, -1, buff, sizeof(buff ),0,0); \
else buff[0] = '\0'; \ else buff[0] = '\0'; \
ok(hres == ret && (FAILED(ret) || !strcmp(buff, str)), \ ok(hres == ret && (FAILED(ret) || !strcmp(buff, str)), \
szVarFmtFail, \ szVarFmtFail, \
(vt)&VT_TYPEMASK,(vt)&~VT_TYPEMASK,fmt?fmt:"<null>",ret,str,hres,buff); \ (vt)&VT_TYPEMASK,(vt)&~VT_TYPEMASK,fmt?fmt:"<null>",ret,str,hres,buff); \
SysFreeString(out); \ SysFreeString(out); \
} while(0) } while(0)
typedef struct tagFMTRES typedef struct tagFMTRES
{ {
skipping to change at line 245 skipping to change at line 227
size_t i; size_t i;
WCHAR buffW[256]; WCHAR buffW[256];
char buff[256]; char buff[256];
VARIANT in; VARIANT in;
VARIANT_BOOL bTrue = VARIANT_TRUE, bFalse = VARIANT_FALSE; VARIANT_BOOL bTrue = VARIANT_TRUE, bFalse = VARIANT_FALSE;
int fd = 0, fw = 0; int fd = 0, fw = 0;
ULONG flags = 0; ULONG flags = 0;
BSTR bstrin, out = NULL; BSTR bstrin, out = NULL;
HRESULT hres; HRESULT hres;
CHECKPTR(VarFormat);
if (PRIMARYLANGID(LANGIDFROMLCID(GetUserDefaultLCID())) != LANG_ENGLISH) if (PRIMARYLANGID(LANGIDFROMLCID(GetUserDefaultLCID())) != LANG_ENGLISH)
{ {
skip("Skipping VarFormat tests for non English language\n"); skip("Skipping VarFormat tests for non English language\n");
return; return;
} }
GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, buff, ARRAY_SIZE(buff)); GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, buff, ARRAY_SIZE(buff));
if (buff[0] != '.' || buff[1]) if (buff[0] != '.' || buff[1])
{ {
skip("Skipping VarFormat tests as decimal separator is '%s'\n", buff); skip("Skipping VarFormat tests as decimal separator is '%s'\n", buff);
return; return;
skipping to change at line 271 skipping to change at line 251
skip("Skipping VarFormat tests as decimal places is '%s'\n", buff); skip("Skipping VarFormat tests as decimal places is '%s'\n", buff);
return; return;
} }
VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"True/False",S_OK,"True"); VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"True/False",S_OK,"True");
VARFMT(VT_BOOL,V_BOOL,VARIANT_FALSE,"True/False",S_OK,"False"); VARFMT(VT_BOOL,V_BOOL,VARIANT_FALSE,"True/False",S_OK,"False");
VNUMFMT(VT_I1,V_I1); VNUMFMT(VT_I1,V_I1);
VNUMFMT(VT_I2,V_I2); VNUMFMT(VT_I2,V_I2);
VNUMFMT(VT_I4,V_I4); VNUMFMT(VT_I4,V_I4);
if (has_i8) VNUMFMT(VT_I8,V_I8);
{
VNUMFMT(VT_I8,V_I8);
}
VNUMFMT(VT_INT,V_INT); VNUMFMT(VT_INT,V_INT);
VNUMFMT(VT_UI1,V_UI1); VNUMFMT(VT_UI1,V_UI1);
VNUMFMT(VT_UI2,V_UI2); VNUMFMT(VT_UI2,V_UI2);
VNUMFMT(VT_UI4,V_UI4); VNUMFMT(VT_UI4,V_UI4);
if (has_i8) VNUMFMT(VT_UI8,V_UI8);
{
VNUMFMT(VT_UI8,V_UI8);
}
VNUMFMT(VT_UINT,V_UINT); VNUMFMT(VT_UINT,V_UINT);
VNUMFMT(VT_R4,V_R4); VNUMFMT(VT_R4,V_R4);
VNUMFMT(VT_R8,V_R8); VNUMFMT(VT_R8,V_R8);
/* Reference types are dereferenced */ /* Reference types are dereferenced */
VARFMT(VT_BOOL|VT_BYREF,V_BOOLREF,&bTrue,"True/False",S_OK,"True"); VARFMT(VT_BOOL|VT_BYREF,V_BOOLREF,&bTrue,"True/False",S_OK,"True");
VARFMT(VT_BOOL|VT_BYREF,V_BOOLREF,&bFalse,"True/False",S_OK,"False"); VARFMT(VT_BOOL|VT_BYREF,V_BOOLREF,&bFalse,"True/False",S_OK,"False");
/* Dates */ /* Dates */
for (i = 0; i < ARRAY_SIZE(VarFormat_date_results); i++) for (i = 0; i < ARRAY_SIZE(VarFormat_date_results); i++)
skipping to change at line 416 skipping to change at line 390
VARFMT(VT_R8,V_R8,0.0094,"#.##",S_OK,".01"); VARFMT(VT_R8,V_R8,0.0094,"#.##",S_OK,".01");
VARFMT(VT_R8,V_R8,0.00099,"#.##",S_OK,"."); VARFMT(VT_R8,V_R8,0.00099,"#.##",S_OK,".");
VARFMT(VT_R8,V_R8,0.0995,"#.##",S_OK,".1"); VARFMT(VT_R8,V_R8,0.0995,"#.##",S_OK,".1");
VARFMT(VT_R8,V_R8,8.0995,"#.##",S_OK,"8.1"); VARFMT(VT_R8,V_R8,8.0995,"#.##",S_OK,"8.1");
VARFMT(VT_R8,V_R8,0.0994,"#.##",S_OK,".1"); VARFMT(VT_R8,V_R8,0.0994,"#.##",S_OK,".1");
VARFMT(VT_R8,V_R8,1.00,"#,##0.00",S_OK,"1.00"); VARFMT(VT_R8,V_R8,1.00,"#,##0.00",S_OK,"1.00");
VARFMT(VT_R8,V_R8,0.0995,"#.###",S_OK,".1"); VARFMT(VT_R8,V_R8,0.0995,"#.###",S_OK,".1");
/* 'out' is not cleared */ /* 'out' is not cleared */
out = (BSTR)0x1; out = (BSTR)0x1;
hres = pVarFormat(&in,NULL,fd,fw,flags,&out); /* Would crash if out is cleared */ hres = VarFormat(&in,NULL,fd,fw,flags,&out); /* Would crash if out is cleared */
ok(hres == S_OK, "got %08x\n", hres); ok(hres == S_OK, "got %08x\n", hres);
SysFreeString(out); SysFreeString(out);
out = NULL; out = NULL;
/* VT_NULL */ /* VT_NULL */
V_VT(&in) = VT_NULL; V_VT(&in) = VT_NULL;
hres = pVarFormat(&in,NULL,fd,fw,0,&out); hres = VarFormat(&in,NULL,fd,fw,0,&out);
ok(hres == S_OK, "VarFormat failed with 0x%08x\n", hres); ok(hres == S_OK, "VarFormat failed with 0x%08x\n", hres);
ok(out == NULL, "expected NULL formatted string\n"); ok(out == NULL, "expected NULL formatted string\n");
/* Invalid args */ /* Invalid args */
hres = pVarFormat(&in,NULL,fd,fw,flags,NULL); hres = VarFormat(&in,NULL,fd,fw,flags,NULL);
ok(hres == E_INVALIDARG, "Null out: expected E_INVALIDARG, got 0x%08x\n", hres ); ok(hres == E_INVALIDARG, "Null out: expected E_INVALIDARG, got 0x%08x\n", hres );
hres = pVarFormat(NULL,NULL,fd,fw,flags,&out); hres = VarFormat(NULL,NULL,fd,fw,flags,&out);
ok(hres == E_INVALIDARG, "Null in: expected E_INVALIDARG, got 0x%08x\n", hres) ; ok(hres == E_INVALIDARG, "Null in: expected E_INVALIDARG, got 0x%08x\n", hres) ;
fd = -1; fd = -1;
VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"",E_INVALIDARG,""); VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"",E_INVALIDARG,"");
fd = 8; fd = 8;
VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"",E_INVALIDARG,""); VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"",E_INVALIDARG,"");
fd = 0; fw = -1; fd = 0; fw = -1;
VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"",E_INVALIDARG,""); VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"",E_INVALIDARG,"");
fw = 4; fw = 4;
VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"",E_INVALIDARG,""); VARFMT(VT_BOOL,V_BOOL,VARIANT_TRUE,"",E_INVALIDARG,"");
} }
static const char *szVarWdnFail = static const char *szVarWdnFail =
"VarWeekdayName (%d, %d, %d, %d, %x): returned %8x, expected %8x\n"; "VarWeekdayName (%d, %d, %d, %d, %x): returned %8x, expected %8x\n";
#define VARWDN(iWeekday, fAbbrev, iFirstDay, dwFlags, ret, buff, out, freeOut) \ #define VARWDN(iWeekday, fAbbrev, iFirstDay, dwFlags, ret, buff, out, freeOut) \
do { \ do { \
hres = pVarWeekdayName(iWeekday, fAbbrev, iFirstDay, dwFlags, &out); \ hres = VarWeekdayName(iWeekday, fAbbrev, iFirstDay, dwFlags, &out); \
if (SUCCEEDED(hres)) { \ if (SUCCEEDED(hres)) { \
WideCharToMultiByte(CP_ACP, 0, out, -1, buff, sizeof(buff), 0, 0); \ WideCharToMultiByte(CP_ACP, 0, out, -1, buff, sizeof(buff), 0, 0); \
if (freeOut) SysFreeString(out); \ if (freeOut) SysFreeString(out); \
} else { \ } else { \
buff[0] = '\0'; \ buff[0] = '\0'; \
} \ } \
ok(hres == ret, \ ok(hres == ret, \
szVarWdnFail, \ szVarWdnFail, \
iWeekday, fAbbrev, iFirstDay, dwFlags, &out, hres, ret \ iWeekday, fAbbrev, iFirstDay, dwFlags, &out, hres, ret \
); \ ); \
skipping to change at line 478 skipping to change at line 452
BSTR out = NULL; BSTR out = NULL;
HRESULT hres; HRESULT hres;
int iWeekday, fAbbrev, iFirstDay; int iWeekday, fAbbrev, iFirstDay;
BSTR dayNames[7][2]; /* Monday-Sunday, full/abbr */ BSTR dayNames[7][2]; /* Monday-Sunday, full/abbr */
DWORD defaultFirstDay; DWORD defaultFirstDay;
int firstDay; int firstDay;
int day; int day;
int size; int size;
DWORD localeValue; DWORD localeValue;
CHECKPTR(VarWeekdayName);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
GetLocaleInfoW(LOCALE_USER_DEFAULT, 0, NULL, 0); GetLocaleInfoW(LOCALE_USER_DEFAULT, 0, NULL, 0);
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{ {
win_skip("GetLocaleInfoW is not implemented\n"); win_skip("GetLocaleInfoW is not implemented\n");
return; return;
} }
/* Initialize days' names */ /* Initialize days' names */
for (day = 0; day <= 6; ++day) for (day = 0; day <= 6; ++day)
skipping to change at line 513 skipping to change at line 485
GetLocaleInfoW( GetLocaleInfoW(
LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK | LOCALE_RETURN_NUMBER, LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK | LOCALE_RETURN_NUMBER,
(LPWSTR)&defaultFirstDay, sizeof(defaultFirstDay) / sizeof(WCHAR)); (LPWSTR)&defaultFirstDay, sizeof(defaultFirstDay) / sizeof(WCHAR));
/* Check invalid arguments */ /* Check invalid arguments */
VARWDN_F(0, 0, 4, 0, E_INVALIDARG); VARWDN_F(0, 0, 4, 0, E_INVALIDARG);
VARWDN_F(8, 0, 4, 0, E_INVALIDARG); VARWDN_F(8, 0, 4, 0, E_INVALIDARG);
VARWDN_F(4, 0, -1, 0, E_INVALIDARG); VARWDN_F(4, 0, -1, 0, E_INVALIDARG);
VARWDN_F(4, 0, 8, 0, E_INVALIDARG); VARWDN_F(4, 0, 8, 0, E_INVALIDARG);
hres = pVarWeekdayName(1, 0, 0, 0, NULL); hres = VarWeekdayName(1, 0, 0, 0, NULL);
ok(E_INVALIDARG == hres, ok(E_INVALIDARG == hres,
"Null pointer: expected E_INVALIDARG, got 0x%08x\n", hres); "Null pointer: expected E_INVALIDARG, got 0x%08x\n", hres);
/* Check all combinations */ /* Check all combinations */
for (iWeekday = 1; iWeekday <= 7; ++iWeekday) for (iWeekday = 1; iWeekday <= 7; ++iWeekday)
{ {
for (fAbbrev = 0; fAbbrev <= 1; ++fAbbrev) for (fAbbrev = 0; fAbbrev <= 1; ++fAbbrev)
{ {
/* 0 = Default, 1 = Sunday, 2 = Monday, .. */ /* 0 = Default, 1 = Sunday, 2 = Monday, .. */
for (iFirstDay = 0; iFirstDay <= 7; ++iFirstDay) for (iFirstDay = 0; iFirstDay <= 7; ++iFirstDay)
skipping to change at line 668 skipping to change at line 640
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT), SO RT_DEFAULT), &str); hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT), SO RT_DEFAULT), &str);
ok(hr == S_OK, "Unexpected return value %08x\n", hr); ok(hr == S_OK, "Unexpected return value %08x\n", hr);
ok(str != NULL, "Got %p\n", str); ok(str != NULL, "Got %p\n", str);
str = NULL; str = NULL;
hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_POLISH, SUBLANG_DEFAULT), SOR T_DEFAULT), &str); hr = GetAltMonthNames(MAKELCID(MAKELANGID(LANG_POLISH, SUBLANG_DEFAULT), SOR T_DEFAULT), &str);
ok(hr == S_OK, "Unexpected return value %08x\n", hr); ok(hr == S_OK, "Unexpected return value %08x\n", hr);
ok(str != NULL, "Got %p\n", str); ok(str != NULL, "Got %p\n", str);
} }
START_TEST(varformat) static void test_VarFormatCurrency(void)
{ {
hOleaut32 = GetModuleHandleA("oleaut32.dll"); HRESULT hr;
VARIANT in;
BSTR str, str2;
has_i8 = GetProcAddress(hOleaut32, "VarI8FromI1") != NULL; V_CY(&in).int64 = 0;
V_VT(&in) = VT_CY;
hr = VarFormatCurrency(&in, 3, -2, -2, -2, 0, &str);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
V_VT(&in) = VT_BSTR;
V_BSTR(&in) = str;
hr = VarFormatCurrency(&in, 1, -2, -2, -2, 0, &str2);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(lstrcmpW(str, str2), "Expected different string.\n");
SysFreeString(str2);
V_VT(&in) = VT_BSTR | VT_BYREF;
V_BSTRREF(&in) = &str;
hr = VarFormatCurrency(&in, 1, -2, -2, -2, 0, &str2);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(lstrcmpW(str, str2), "Expected different string.\n");
SysFreeString(str);
SysFreeString(str2);
V_VT(&in) = VT_BSTR;
V_BSTR(&in) = SysAllocString(L"test");
hr = VarFormatCurrency(&in, 1, -2, -2, -2, 0, &str2);
ok(hr == DISP_E_TYPEMISMATCH, "Unexpected hr %#x.\n", hr);
VariantClear(&in);
}
test_VarFormatNumber(); START_TEST(varformat)
test_VarFormat(); {
test_VarWeekdayName(); test_VarFormatNumber();
test_VarFormatFromTokens(); test_VarFormat();
test_GetAltMonthNames(); test_VarWeekdayName();
test_VarFormatFromTokens();
test_GetAltMonthNames();
test_VarFormatCurrency();
} }
 End of changes. 21 change blocks. 
52 lines changed or deleted 53 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)