Module: wine Branch: master Commit: bf9077cf97aa9b73e0627d468fb9a9376ff897a1 URL: https://source.winehq.org/git/wine.git/?a=commit;h=bf9077cf97aa9b73e0627d468...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Jul 21 14:15:56 2021 +0200
oleaut32/tests: Remove unneeded casts in vartest.
The error codes are already defined with an HRESULT cast so there is no need to cast them again.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/oleaut32/tests/vartest.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index c0c20dcf10f..0ce165b44fa 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -1288,8 +1288,8 @@ static HRESULT convert_str( const char *str, INT dig, ULONG flags, static void expect_NumFromStr( int line, HRESULT hres, NUMPARSE *np, INT a, ULONG b, ULONG c, INT d, INT e, INT f ) { - ok_(__FILE__,line)(hres == (HRESULT)S_OK, "returned %08x\n", hres); - if (hres == (HRESULT)S_OK) + ok_(__FILE__,line)(hres == S_OK, "returned %08x\n", hres); + if (hres == S_OK) { ok_(__FILE__,line)(np->cDig == a, "Expected cDig = %d, got %d\n", a, np->cDig); ok_(__FILE__,line)(np->dwInFlags == b, "Expected dwInFlags = 0x%x, got 0x%x\n", b, np->dwInFlags); @@ -1306,7 +1306,7 @@ static void expect_NumFromStr( int line, HRESULT hres, NUMPARSE *np, INT a, ULON #define CONVERT(str,flags) CONVERTN(str,sizeof(rgb),flags) #define EXPECT(a,b,c,d,e,f) expect_NumFromStr( __LINE__, hres, &np, a, b, c, d, e, f ) #define EXPECTRGB(a,b) ok(rgb[a] == b, "Digit[%d], expected %d, got %d\n", a, b, rgb[a]) -#define EXPECTFAIL ok(hres == (HRESULT)DISP_E_TYPEMISMATCH, "Call succeeded, hres = %08x\n", hres) +#define EXPECTFAIL ok(hres == DISP_E_TYPEMISMATCH, "Call succeeded, hres = %08x\n", hres) #define EXPECT2(a,b) EXPECTRGB(0,a); EXPECTRGB(1,b)
static void test_VarParseNumFromStrEn(void) @@ -2190,10 +2190,10 @@ static HRESULT (WINAPI *pVarNumFromParseNum)(NUMPARSE*,BYTE*,ULONG,VARIANT*); np.cDig = (a); np.dwInFlags = (b); np.dwOutFlags = (c); np.cchUsed = (d); \ np.nBaseShift = (e); np.nPwr10 = (f); hres = pVarNumFromParseNum(&np, rgb, bits, &vOut) static const char *szFailOverflow = "Expected overflow, hres = %08x\n"; -#define EXPECT_OVERFLOW ok(hres == (HRESULT)DISP_E_OVERFLOW, szFailOverflow, hres) +#define EXPECT_OVERFLOW ok(hres == DISP_E_OVERFLOW, szFailOverflow, hres) static const char *szFailOk = "Call failed, hres = %08x\n"; -#define EXPECT_OK ok(hres == (HRESULT)S_OK, szFailOk, hres); \ - if (hres == (HRESULT)S_OK) +#define EXPECT_OK ok(hres == S_OK, szFailOk, hres); \ + if (hres == S_OK) #define EXPECT_TYPE(typ) ok(V_VT(&vOut) == typ,"Expected Type = " #typ ", got %d\n", V_VT(&vOut)) #define EXPECT_I1(val) EXPECT_OK { EXPECT_TYPE(VT_I1); \ ok(V_I1(&vOut) == val, "Expected i1 = %d, got %d\n", (signed char)val, V_I1(&vOut)); }