Alistair Leslie-Hughes : dpnet/tests: Stop thread test from failing.

Alexandre Julliard julliard at winehq.org
Tue Mar 14 16:14:37 CDT 2017


Module: wine
Branch: master
Commit: 1bca8df8cbc87691627f6d0f643fc355eb11b30e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1bca8df8cbc87691627f6d0f643fc355eb11b30e

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Sun Mar 12 22:01:09 2017 +0000

dpnet/tests: Stop thread test from failing.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dpnet/tests/thread.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/dpnet/tests/thread.c b/dlls/dpnet/tests/thread.c
index 7129739..99de2be 100644
--- a/dlls/dpnet/tests/thread.c
+++ b/dlls/dpnet/tests/thread.c
@@ -119,7 +119,7 @@ static void test_enum_hosts(void)
     DPN_APPLICATION_DESC appdesc;
     DPNHANDLE async = 0, async2 = 0;
     static const WCHAR localhost[] = {'1','2','7','.','0','.','0','.','1',0};
-    DWORD threadcnt;
+    DWORD threadcnt, threadorig;
 
     enumevent = CreateEventA( NULL, TRUE, FALSE, NULL);
 
@@ -170,9 +170,10 @@ static void test_enum_hosts(void)
     ok(hr == DPNSUCCESS_PENDING, "IDirectPlay8Client_EnumHosts failed with 0x%08x\n", hr);
     todo_wine ok(async, "No Handle returned\n");
 
-    hr = IDirectPlay8ThreadPool_GetThreadCount(pool1, -1, &threadcnt, 0);
+    /* The first EnumHosts call will increase the thread count */
+    hr = IDirectPlay8ThreadPool_GetThreadCount(pool1, -1, &threadorig, 0);
     ok(hr == S_OK, "got 0x%08x\n", hr);
-    todo_wine ok(threadcnt == 6, "got %d\n", threadcnt);
+    todo_wine ok(threadorig > 1, "got %d\n", threadorig);
 
     hr = IDirectPlay8Client_EnumHosts(client, &appdesc, host, local, NULL, 0, INFINITE, 0, INFINITE, NULL,  &async2, 0);
     ok(hr == DPNSUCCESS_PENDING, "IDirectPlay8Client_EnumHosts failed with 0x%08x\n", hr);
@@ -181,21 +182,21 @@ static void test_enum_hosts(void)
 
     hr = IDirectPlay8ThreadPool_GetThreadCount(pool1, -1, &threadcnt, 0);
     ok(hr == S_OK, "got 0x%08x\n", hr);
-    todo_wine ok(threadcnt == 6, "got %d\n", threadcnt);
+    ok(threadcnt == threadorig, "got %d\n", threadcnt);
 
     hr = IDirectPlay8Client_CancelAsyncOperation(client, async, 0);
     ok(hr == S_OK, "IDirectPlay8Client_CancelAsyncOperation failed with 0x%08x\n", hr);
 
     hr = IDirectPlay8ThreadPool_GetThreadCount(pool1, -1, &threadcnt, 0);
     ok(hr == S_OK, "got 0x%08x\n", hr);
-    todo_wine ok(threadcnt == 6, "got %d\n", threadcnt);
+    ok(threadcnt == threadorig, "got %d\n", threadcnt);
 
     hr = IDirectPlay8Client_CancelAsyncOperation(client, async2, 0);
     ok(hr == S_OK, "IDirectPlay8Client_CancelAsyncOperation failed with 0x%08x\n", hr);
 
     hr = IDirectPlay8ThreadPool_GetThreadCount(pool1, -1, &threadcnt, 0);
     ok(hr == S_OK, "got 0x%08x\n", hr);
-    todo_wine ok(threadcnt == 6, "got %d\n", threadcnt);
+    ok(threadcnt == threadorig, "got %d\n", threadcnt);
 
     IDirectPlay8Address_Release(local);
     IDirectPlay8Address_Release(host);




More information about the wine-cvs mailing list