user32/tests: Skip some input tests if we fail to queue keyboard events.
This commit is contained in:
parent
4c65a3c278
commit
9783f67625
|
@ -203,7 +203,7 @@ static int KbdMessage( KEV kev, WPARAM *pwParam, LPARAM *plParam )
|
||||||
* . retrieve the messages from the input queue
|
* . retrieve the messages from the input queue
|
||||||
* . verify
|
* . verify
|
||||||
*/
|
*/
|
||||||
static void do_test( HWND hwnd, int seqnr, const KEV td[] )
|
static BOOL do_test( HWND hwnd, int seqnr, const KEV td[] )
|
||||||
{
|
{
|
||||||
INPUT inputs[MAXKEYEVENTS];
|
INPUT inputs[MAXKEYEVENTS];
|
||||||
KMSG expmsg[MAXKEYEVENTS];
|
KMSG expmsg[MAXKEYEVENTS];
|
||||||
|
@ -238,20 +238,25 @@ static void do_test( HWND hwnd, int seqnr, const KEV td[] )
|
||||||
ok( msg.message == expmsg[i].message &&
|
ok( msg.message == expmsg[i].message &&
|
||||||
msg.wParam == expmsg[i].wParam &&
|
msg.wParam == expmsg[i].wParam &&
|
||||||
msg.lParam == expmsg[i].lParam,
|
msg.lParam == expmsg[i].lParam,
|
||||||
"wrong message! expected:\n"
|
"%u: wrong message %x expected %s wParam %04lx lParam %08lx\n",
|
||||||
"message[%d] %-15s wParam %04lx lParam %08lx\n",i,
|
i, msg.message, MSGNAME[(expmsg[i]).message - WM_KEYFIRST],
|
||||||
MSGNAME[(expmsg[i]).message - WM_KEYFIRST],
|
|
||||||
expmsg[i].wParam, expmsg[i].lParam );
|
expmsg[i].wParam, expmsg[i].lParam );
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (winetest_debug > 1)
|
if (winetest_debug > 1)
|
||||||
trace("%d messages retrieved\n", i);
|
trace("%d messages retrieved\n", i);
|
||||||
|
if (!i && kmctr)
|
||||||
|
{
|
||||||
|
skip( "simulated keyboard input doesn't work\n" );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
ok( i == kmctr, "message count is wrong: got %d expected: %d\n", i, kmctr);
|
ok( i == kmctr, "message count is wrong: got %d expected: %d\n", i, kmctr);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test all combinations of the specified key events */
|
/* test all combinations of the specified key events */
|
||||||
static void TestASet( HWND hWnd, int nrkev, const KEV kevdwn[], const KEV kevup[] )
|
static BOOL TestASet( HWND hWnd, int nrkev, const KEV kevdwn[], const KEV kevup[] )
|
||||||
{
|
{
|
||||||
int i,j,k,l,m,n;
|
int i,j,k,l,m,n;
|
||||||
static int count=0;
|
static int count=0;
|
||||||
|
@ -266,7 +271,7 @@ static void TestASet( HWND hWnd, int nrkev, const KEV kevdwn[], const KEV kevup[
|
||||||
kbuf[1] = kevdwn[1-i];
|
kbuf[1] = kevdwn[1-i];
|
||||||
kbuf[2] = kevup[j];
|
kbuf[2] = kevup[j];
|
||||||
kbuf[3] = kevup[1-j];
|
kbuf[3] = kevup[1-j];
|
||||||
do_test( hWnd, count++, kbuf);
|
if (!do_test( hWnd, count++, kbuf)) return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -288,7 +293,7 @@ static void TestASet( HWND hWnd, int nrkev, const KEV kevdwn[], const KEV kevup[
|
||||||
kbuf[3] = kevup[l];
|
kbuf[3] = kevup[l];
|
||||||
kbuf[4] = kevup[m];
|
kbuf[4] = kevup[m];
|
||||||
kbuf[5] = kevup[n];
|
kbuf[5] = kevup[n];
|
||||||
do_test( hWnd, count++, kbuf);
|
if (!do_test( hWnd, count++, kbuf)) return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,6 +301,7 @@ static void TestASet( HWND hWnd, int nrkev, const KEV kevdwn[], const KEV kevup[
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test each set specified in the global testkeyset array */
|
/* test each set specified in the global testkeyset array */
|
||||||
|
@ -303,8 +309,7 @@ static void TestSysKeys( HWND hWnd)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i=0; testkeyset[i].nrkev;i++)
|
for(i=0; testkeyset[i].nrkev;i++)
|
||||||
TestASet( hWnd, testkeyset[i].nrkev, testkeyset[i].keydwn,
|
if (!TestASet( hWnd, testkeyset[i].nrkev, testkeyset[i].keydwn, testkeyset[i].keyup)) break;
|
||||||
testkeyset[i].keyup);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam,
|
static LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam,
|
||||||
|
|
Loading…
Reference in New Issue