Fix for comparisons in netapi32/tests
Two comparisons were always true due to the types. Not sure about the proper fix though. Changelog: Changed comparisons so they're not always true. Vincent Index: wine/dlls/netapi32/tests/apibuf.c =================================================================== RCS file: /home/wine/wine/dlls/netapi32/tests/apibuf.c,v retrieving revision 1.1 diff -u -r1.1 apibuf.c --- wine/dlls/netapi32/tests/apibuf.c 11 Sep 2002 02:35:18 -0000 1.1 +++ wine/dlls/netapi32/tests/apibuf.c 10 Dec 2002 17:25:20 -0000 @@ -48,14 +48,14 @@ ok(NetApiBufferFree(p) == NERR_Success, "Freed"); ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size"); - ok(dwSize >= 0, "The size"); + ok(dwSize < 0x80000000, "The size"); ok(NetApiBufferSize(NULL, &dwSize) == ERROR_INVALID_PARAMETER, "Error for NULL pointer"); /* 0-length buffer */ ok(NetApiBufferAllocate(0, (LPVOID *)&p) == NERR_Success, "Reserved memory"); ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size"); - ok((dwSize >= 0) && (dwSize < 0xFFFFFFFF),"The size of the 0-length buffer"); + ok(dwSize < 0xFFFFFFFF, "The size of the 0-length buffer"); ok(NetApiBufferFree(p) == NERR_Success, "Freed"); }
ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size"); - ok(dwSize >= 0, "The size"); + ok(dwSize < 0x80000000, "The size"); [...] ok(NetApiBufferAllocate(0, (LPVOID *)&p) == NERR_Success, "Reserved memory"); ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size"); - ok((dwSize >= 0) && (dwSize < 0xFFFFFFFF),"The size of the 0-length buffer"); + ok(dwSize < 0xFFFFFFFF, "The size of the 0-length buffer"); I think this test does not make sense. Why would 0xfffffffe be considered valid and not 0xffffffff? The truth is we have no idea what value to expect from a call to NetApiBufferAllocate(0,...) and thus there is nothing to test. The < 0x80000000 test just above seems just as arbitrary (just a better approximation of 'if this were a signed int would it be positive?'). So I vote to just remove both tests, or, for the first case, to actually find out what value we should expect (but I doubt this is documented). -- Francois Gouget fgouget(a)free.fr http://fgouget.free.fr/ The nice thing about meditation is that it makes doing nothing quite respectable -- Paul Dean
participants (2)
-
Francois Gouget -
Vincent Béron