[1/4] ws2_32/tests: Resend: IPv6 tests for WSAAddressToStringA

Detlef Riekenberg wine.dev at web.de
Mon Apr 27 14:13:52 CDT 2009

On Mo, 2009-04-27 at 20:48 +1000, Jeff Latimer wrote:
> -    ok( len == sizeof( expect4 ), "Got size %d\n", len);
> +    ok( len == sizeof( expect4 ), "Expected size to be %d, got %d\n",
> sizeof( expect4 ), len);

Do not use sizeof() in a test.

> +    /*check to see it IPv6 is available */
> +    v6 = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
> +    if (v6 == INVALID_SOCKET) {
> +        skip("Could not create IPv6 socket (LastError: %d; %d
> expected if IPv6 not available).\n",
> +            WSAGetLastError(), WSAEAFNOSUPPORT);
> +        goto end;

There is no reason, that the reader must guess from the log, if the
is a failure or an expected behavior.
You should detect, that IPv6 is not available and handle that case nice.

if ((v6 == INVALID_SOCKET) && (WSAGetLastError() == WSAEAFNOSUPPORT)) {
   skip("IPv6 not supported on this system\n");
   goto end;

    "create an IPv6 socket failed with %d\n",

if (v6 == INVALID_SOCKET) {
    skip("No IPv6 socket\n");
    goto end;

I know, that the same message is already in the current logs.
That should be handled the same way.

Thanks for pick up IPv6

By by ... Detlef

More information about the wine-devel mailing list