On Tue, Oct 09, 2007 at 11:20:49AM +0200, Hans Leidekker wrote:
On Monday 08 October 2007 23:25:06 Marcus Meissner wrote:
BUT I would like to test run it on windows first, so can someone please run following patch against a real Windows?
toolhelp.c:145: Test failed: new process at position 26 in snapshot, expected 1. toolhelp.c:146: Test failed: this process at position 25 in snapshot, expected 0.
Hmm, windows has more processes running of course.
Can you revert the above and use this simpler check? (and try running it some times to see randomness, if any.)
Ciao, Marcus
diff --git a/dlls/kernel32/tests/toolhelp.c b/dlls/kernel32/tests/toolhelp.c index ca9c06c..b9e17c6 100644 --- a/dlls/kernel32/tests/toolhelp.c +++ b/dlls/kernel32/tests/toolhelp.c @@ -108,6 +108,7 @@ static void test_process(DWORD curr_pid, MODULEENTRY32 me; unsigned found = 0; int num = 0; + int pos1 = -1 , pos2 = -1;
hSnapshot = pCreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); ok(hSnapshot != NULL, "Cannot create snapshot\n"); @@ -118,8 +119,8 @@ static void test_process(DWORD curr_pid, { do { - if (pe.th32ProcessID == curr_pid) found++; - if (pe.th32ProcessID == sub_pcs_pid) found++; + if (pe.th32ProcessID == curr_pid) { pos1 = num; found++; } + if (pe.th32ProcessID == sub_pcs_pid) { pos2 = num; found++; } trace("PID=%x %s\n", pe.th32ProcessID, pe.szExeFile); num++; } while (pProcess32Next( hSnapshot, &pe )); @@ -141,6 +142,8 @@ static void test_process(DWORD curr_pid, ok(found == 2, "couldn't find self and/or sub-process in process list\n"); ok(!num, "mismatch in counting\n");
+ ok (pos2 > pos1, "father at pos %d, son at pos %d, expect son after father.\n", pos2, pos1); + te.dwSize = sizeof(te); ok(!pThread32First( hSnapshot, &te ), "shouldn't return a thread\n");