- remove return: now break loop if can't change state during test

- add test for value returned by SwapMouseButton
- fix SwapMouseButton return value (it returns previous state)
This commit is contained in:
Vitaly Lipatov 2005-08-25 19:18:49 +00:00 committed by Alexandre Julliard
parent 030dbe2d98
commit a4590d2b23
2 changed files with 12 additions and 2 deletions

View File

@ -2405,10 +2405,16 @@ INT WINAPI GetSystemMetrics( INT index )
/***********************************************************************
* SwapMouseButton (USER32.@)
* Reverse or restore the meaning of the left and right mouse buttons
* fSwap [I ] TRUE - reverse, FALSE - original
* RETURN
* previous state
*/
BOOL WINAPI SwapMouseButton( BOOL fSwap )
{
return SystemParametersInfoW(SPI_SETMOUSEBUTTONSWAP, fSwap, 0, 0);
BOOL prev = GetSystemMetrics(SM_SWAPBUTTON);
SystemParametersInfoW(SPI_SETMOUSEBUTTONSWAP, fSwap, 0, 0);
return prev;
}

View File

@ -1011,7 +1011,7 @@ static void test_SPI_SETMOUSEBUTTONSWAP( void ) /* 33 */
rc=SystemParametersInfoA( SPI_SETMOUSEBUTTONSWAP, vals[i], 0,
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE );
if (!test_error_msg(rc,"SPI_{GET,SET}MOUSEBUTTONSWAP"))
return;
break;
test_change_message( SPI_SETMOUSEBUTTONSWAP, 0 );
test_reg_key( SPI_SETMOUSEBUTTONSWAP_REGKEY,
@ -1019,6 +1019,10 @@ static void test_SPI_SETMOUSEBUTTONSWAP( void ) /* 33 */
vals[i] ? "1" : "0" );
eq( GetSystemMetrics( SM_SWAPBUTTON ), (int)vals[i],
"SM_SWAPBUTTON", "%d" );
rc=SwapMouseButton((BOOL)vals[i^1]);
eq( GetSystemMetrics( SM_SWAPBUTTON ), (int)vals[i^1],
"SwapMouseButton", "%d" );
ok( rc==vals[i], "SwapMouseButton does not return previous state (really %d)\n", rc );
}
rc=SystemParametersInfoA( SPI_SETMOUSEBUTTONSWAP, old_b, 0,