[PATCH 5/5] ws2_32/tests: Add tabular socket option validity tests

Alex Henrie alexhenrie24 at gmail.com
Mon Aug 16 23:10:52 CDT 2021


On Mon, Aug 16, 2021 at 10:42 AM Zebediah Figura (she/her)
<zfigura at codeweavers.com> wrote:
>
> This patch loses the tests for IP_ADD_MEMBERSHIP et al.

IP(V6)_ADD_MEMBERSHIP is 12 and IP(V6)_DROP_MEMBERSHIP is 13. The new
tests for them are as rigorous as the old ones, they just don't appear
in the tables because they fall into the default case.

> Also:
>
> > +    for (opt = 0; opt < 100; opt++)
>
> I'm not a huge fan of this. It kind of works for IP options, but it
> wouldn't work if we extended these tests to e.g. SOL_SOCKET. I'm also
> not sure I see the value in exhaustively testing undocumented or invalid
> sockopts. Maybe check one or two obviously invalid numbers just to show
> what the invalid behaviour is (and of course put that in the table proper).

OK, I'll make those changes.

> > +        { IPV6_GET_IFLIST,            WSAEINVAL,    BROKEN /* win8 */ | TODO                                          },
>
> This still isn't clear enough to me; it looks like it means "broken on
> windows 8", not "broken on anything before windows 8".
>
> Also, what's the broken case anyway? If it's just a matter of some
> versions not supporting the option yet and returning WSAENOPROTOOPT, is
> it even worth putting it in the table? Can we just have a blanket "||
> broken(ret == -1 && WSAGetLastError() == WSAENOPROTOOPT)"?

Yes, we can have a blanket broken statement, that would be fine.

> > +        { 2,                          WSAEINVAL,    TODO                                                              },
>
> This is IPV6_HDRINCL.
>
> > +        { 47,                         WSAEINVAL,    BROKEN /* vista */ | TODO                                         },
>
> IP_ORIGINAL_ARRIVAL_IF (yes, used with IPPROTO_IPV6; see [1].)
>
> [1]
> https://docs.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options

Thanks for catching those!

-Alex



More information about the wine-devel mailing list