kernel32: Fix a test that fails on all NT platforms

Paul Vriens at
Tue Apr 22 01:33:25 CDT 2008

James Hawkins wrote:
> Hi,
> Changelog:
> * Fix a test that fails on all NT platforms.
>  dlls/kernel32/tests/toolhelp.c |   12 +++++++++---
>  1 files changed, 9 insertions(+), 3 deletions(-)
> ------------------------------------------------------------------------
Hi James,

I've been looking at some of the patches to fix the tests but I'm a bit unsure 
if some of them are the correct way to go. Things like:

+    /* win9x does not return a thread, NT does */
      te.dwSize = sizeof(te);
-    ok(!pThread32First( hSnapshot, &te ), "shouldn't return a thread\n");
+    ret = pThread32First( hSnapshot, &te );
+    ok(ret || !ret, "You'll never see this\n");

renders the whole test useless. It turns out that win9x in this case leaves 
te.dwSize and XP-and-up set te.dwSize to 0. Shouldn't we make use of that fact?
So something like (or another combination):

if (te.dwSize == 0)
    XP-and-up, expect failure
else if (te.dwSize == sizeof(te))
    win9x, expect success
   something is wrong/unexpected

On a sidenote (and this has been the case for a long time):

I've seen patches where


is turned into

c = function(a,b);
if (c)

but done without a skip or such. So if Wine has a regression for 'function' we 
won't notice.

We have loads of patches where we expect 3 or more different last errors. This 
will make sure the tests always succeed of course but makes it difficult to tell 
if we (Wine) are doing the correct/best thing.



More information about the wine-devel mailing list