oleaut32: Fix some VarCyFrom* tests.

Due to a broken EXPECTRES macro the EXPECT_OVERFLOW accepts S_OK return
values.
This commit is contained in:
Michael Stefaniuc 2011-10-07 01:36:57 +02:00 committed by Alexandre Julliard
parent 6b164a52e2
commit 38794b4ba0
2 changed files with 7 additions and 3 deletions

View File

@ -3720,7 +3720,9 @@ static void test_VarCyFromUI8(void)
CONVERT(VarCyFromUI8, 0); EXPECTCY(0);
CONVERT(VarCyFromUI8, 1); EXPECTCY(1);
CONVERT_I8(VarCyFromUI8, 214748, 1566804068); EXPECTCY64(2147483647ul, 4294951488ul);
CONVERT_I8(VarCyFromUI8, 214748, 1566804069); EXPECT_OVERFLOW;
CONVERT_I8(VarCyFromUI8, 214748, 1566804069); EXPECTCY64(2147483647ul, 4294961488ul);
CONVERT_I8(VarCyFromUI8, 214748, 1566804070); EXPECT_OVERFLOW;
CONVERT_I8(VarCyFromUI8, 214749, 1566804068); EXPECT_OVERFLOW;
}
static void test_VarCyFromDec(void)
@ -3736,7 +3738,9 @@ static void test_VarCyFromDec(void)
CONVERT_DEC(VarCyFromDec,0,0,0,1); EXPECTCY(1);
CONVERT_DEC64(VarCyFromDec,0,0,0,214748, 1566804068); EXPECTCY64(2147483647ul, 4294951488ul);
CONVERT_DEC64(VarCyFromDec,0,0,0,214748, 1566804069); EXPECT_OVERFLOW;
CONVERT_DEC64(VarCyFromDec,0,0,0,214748, 1566804069); EXPECTCY64(2147483647ul, 4294961488ul);
CONVERT_DEC64(VarCyFromDec,0,0,0,214748, 1566804070); EXPECT_OVERFLOW;
CONVERT_DEC64(VarCyFromDec,0,0,0,214749, 1566804068); EXPECT_OVERFLOW;
CONVERT_DEC(VarCyFromDec,2,0,0,100); EXPECTCY(1);
CONVERT_DEC(VarCyFromDec,2,0x80,0,100); EXPECTCY(-1);

View File

@ -3764,7 +3764,7 @@ HRESULT WINAPI VarCyFromI8(LONG64 llIn, CY* pCyOut)
*/
HRESULT WINAPI VarCyFromUI8(ULONG64 ullIn, CY* pCyOut)
{
if (ullIn >= (I8_MAX/CY_MULTIPLIER)) return DISP_E_OVERFLOW;
if (ullIn > (I8_MAX/CY_MULTIPLIER)) return DISP_E_OVERFLOW;
pCyOut->int64 = ullIn * CY_MULTIPLIER;
return S_OK;
}