Commit 38794b4b authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

oleaut32: Fix some VarCyFrom* tests.

Due to a broken EXPECTRES macro the EXPECT_OVERFLOW accepts S_OK return values.
parent 6b164a52
...@@ -3720,7 +3720,9 @@ static void test_VarCyFromUI8(void) ...@@ -3720,7 +3720,9 @@ static void test_VarCyFromUI8(void)
CONVERT(VarCyFromUI8, 0); EXPECTCY(0); CONVERT(VarCyFromUI8, 0); EXPECTCY(0);
CONVERT(VarCyFromUI8, 1); EXPECTCY(1); CONVERT(VarCyFromUI8, 1); EXPECTCY(1);
CONVERT_I8(VarCyFromUI8, 214748, 1566804068); EXPECTCY64(2147483647ul, 4294951488ul); 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) static void test_VarCyFromDec(void)
...@@ -3736,7 +3738,9 @@ static void test_VarCyFromDec(void) ...@@ -3736,7 +3738,9 @@ static void test_VarCyFromDec(void)
CONVERT_DEC(VarCyFromDec,0,0,0,1); EXPECTCY(1); 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, 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,0,0,100); EXPECTCY(1);
CONVERT_DEC(VarCyFromDec,2,0x80,0,100); EXPECTCY(-1); CONVERT_DEC(VarCyFromDec,2,0x80,0,100); EXPECTCY(-1);
......
...@@ -3764,7 +3764,7 @@ HRESULT WINAPI VarCyFromI8(LONG64 llIn, CY* pCyOut) ...@@ -3764,7 +3764,7 @@ HRESULT WINAPI VarCyFromI8(LONG64 llIn, CY* pCyOut)
*/ */
HRESULT WINAPI VarCyFromUI8(ULONG64 ullIn, 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; pCyOut->int64 = ullIn * CY_MULTIPLIER;
return S_OK; return S_OK;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment