[PATCH 4/5] ws2_32/tests: some IP_HDRINCL tests pass on FreeBSD

Alexandre Julliard julliard at winehq.org
Mon Jan 6 15:16:28 CST 2020


Damjan Jovanovic <damjan.jov at gmail.com> writes:

> Signed-off-by: Damjan Jovanovic <damjan.jov at gmail.com>
> ---
>  dlls/ws2_32/tests/sock.c | 36 ++++++++++++++++++++++++++++++++----
>  1 file changed, 32 insertions(+), 4 deletions(-)
>
> diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
> index 6ee50d94b6..1a3eba529e 100644
> --- a/dlls/ws2_32/tests/sock.c
> +++ b/dlls/ws2_32/tests/sock.c
> @@ -1688,30 +1688,58 @@ todo_wine
>          err = setsockopt(s, IPPROTO_IP, IP_HDRINCL, (char *) &k, size);
>          if (err == -1) /* >= Vista */
>          {
> -            todo_wine {
> +#if defined(linux)
> +todo_wine
> +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> +todo_wine_if (prottest[i].family == AF_INET)
> +#endif
>              ok(GetLastError() == WSAEINVAL, "Expected 10022, got %d\n", GetLastError());
>              k = 99;
>              SetLastError(0xdeadbeef);
>              err = getsockopt(s, IPPROTO_IP, IP_HDRINCL, (char *) &k, &size);
> +#if defined(linux)
> +todo_wine
> +#endif
>              ok(err == -1, "Expected -1, got %d\n", err);
> +#if defined(linux)
> +todo_wine
> +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> +todo_wine_if (prottest[i].family == AF_INET)
> +#endif
>              ok(GetLastError() == WSAEINVAL, "Expected 10022, got %d\n", GetLastError());
> +#if defined(linux)
> +todo_wine
> +#endif
>              ok(k == 99, "Expected 99, got %d\n", k);
>  
>              size = sizeof(k);
>              k = 0;
>              SetLastError(0xdeadbeef);
>              err = setsockopt(s, IPPROTO_IP, IP_HDRINCL, (char *) &k, size);
> -            }
>              ok(err == -1, "Expected -1, got %d\n", err);
> -            todo_wine {
> +#if defined(linux)
> +todo_wine
> +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> +todo_wine_if (prottest[i].family == AF_INET)
> +#endif
>              ok(GetLastError() == WSAEINVAL, "Expected 10022, got %d\n", GetLastError());
>              k = 99;
>              SetLastError(0xdeadbeef);
>              err = getsockopt(s, IPPROTO_IP, IP_HDRINCL, (char *) &k, &size);
> +#if defined(linux)
> +todo_wine
> +#endif
>              ok(err == -1, "Expected -1, got %d\n", err);
> +#if defined(linux)
> +todo_wine
> +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> +todo_wine_if (prottest[i].family == AF_INET)
> +#endif
>              ok(GetLastError() == WSAEINVAL, "Expected 10022, got %d\n", GetLastError());
> +#if defined(linux)
> +todo_wine
> +#endif

I don't think we want to add a million #ifdefs for this. It would be
better to fix the code to work correctly in a platform-independent way.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list