[5/5] ws2_32/tests: Tests for invalid conditions in InetNtop

Paul Vriens paul.vriens.wine at gmail.com
Mon Mar 9 02:09:05 CDT 2009


Jeff Latimer wrote:
> MSDN defines an number of conditions that inet_ntop will return errors. 
>  This patch tests for them.
> ---
>  dlls/ws2_32/socket.c     |   30 +++++++++++++++-
>  dlls/ws2_32/tests/sock.c |   83 
> ++++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 109 insertions(+), 4 deletions(-)
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
I think you can get rid of these comments:

/* MSDN says it returns ERROR_INVALID_PARAMETER in MSDN but Vista returns
    0xc000000d - STATUS_INVALID_PARAMETER */

MSDN has proven to be wrong on occasion and there is no need to put that in the 
code.

Secondly you shouldn't use magic number if you no the name:

WSASetLastError(0xc000000d);

In the tests you do:

+        ok(WSAGetLastError() == 0xC000000D,
+           "Should be ERROR_INVALID_PARAMETER not %x\n", WSAGetLastError());

Again the magic number and in this case the ok() message is wrong as that should 
be STATUS_INVALID_PARAMETER according to your testing.

-- 
Cheers,

Paul.



More information about the wine-devel mailing list