mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 21:46:05 +00:00
[SHELL32_APITEST] Run the CUserNotification worker test function in a thread to copy with possible test timeouts. CORE-13177
This commit is contained in:
parent
bdae0cce66
commit
b77840d3a2
1 changed files with 33 additions and 3 deletions
|
@ -171,9 +171,39 @@ TestNotification(void)
|
||||||
ok_hr(hr, S_FALSE);
|
ok_hr(hr, S_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DWORD
|
||||||
|
CALLBACK
|
||||||
|
TestThread(LPVOID lpParam)
|
||||||
|
{
|
||||||
|
/* Initialize COM */
|
||||||
|
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||||
|
|
||||||
|
/* Start the test */
|
||||||
|
TestNotification();
|
||||||
|
|
||||||
|
/* Cleanup and return */
|
||||||
|
CoUninitialize();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(CUserNotification)
|
START_TEST(CUserNotification)
|
||||||
{
|
{
|
||||||
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
HANDLE hThread;
|
||||||
TestNotification();
|
DWORD dwWait;
|
||||||
CoUninitialize();
|
|
||||||
|
/* We create a test thread, because the notification tests can hang */
|
||||||
|
hThread = CreateThread(NULL, 0, TestThread, NULL, 0, NULL);
|
||||||
|
ok(hThread != NULL, "CreateThread failed with error 0x%lu\n", GetLastError());
|
||||||
|
if (!hThread)
|
||||||
|
{
|
||||||
|
skip("Could not create the CUserNotification test thread!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Wait a maximum of 1:30 for the thread to finish (the timeout tests take some time) */
|
||||||
|
dwWait = WaitForSingleObject(hThread, 90 * 1000);
|
||||||
|
ok(dwWait == WAIT_OBJECT_0, "WaitForSingleObject returned %lu, expected WAIT_OBJECT_0\n", dwWait);
|
||||||
|
|
||||||
|
/* Cleanup and return */
|
||||||
|
CloseHandle(hThread);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue