localui/tests: improve EnumPortsW tests

Austin English austinenglish at gmail.com
Mon Feb 7 16:57:52 CST 2011


https://testbot.winehq.org/JobDetails.pl?Key=8950

-- 
-Austin
-------------- next part --------------
diff --git a/dlls/localui/tests/localui.c b/dlls/localui/tests/localui.c
index cb7a1cf..109f08a 100644
--- a/dlls/localui/tests/localui.c
+++ b/dlls/localui/tests/localui.c
@@ -70,10 +70,15 @@ static PORT_INFO_2W * find_portinfo2(LPWSTR pPort)
     DWORD   res;
 
     if (!pi_buffer) {
+        SetLastError(0xdeadbeef);
         res = EnumPortsW(NULL, 2, NULL, 0, &pi_needed, &pi_numports);
+        ok(!res, "EnumPorts failed: got %d\n", res);
+        ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError was %u\n", GetLastError());
         pi_buffer = HeapAlloc(GetProcessHeap(), 0, pi_needed);
         SetLastError(0xdeadbeef);
         res = EnumPortsW(NULL, 2, pi_buffer, pi_needed, &pi_needed, &pi_numports);
+        ok(res == 1, "EnumPorts failed: got %d\n", res);
+        todo_wine ok(GetLastError() == ERROR_SUCCESS, "LastError was %u\n", GetLastError());
     }
     if (pi_buffer) {
         pi = (PORT_INFO_2W *) pi_buffer;


More information about the wine-patches mailing list