[PATCH 2/3] ntdll/tests: Add tests for RtlIpv6StringToAddress (try 3)

Stefan Dösinger stefandoesinger at gmail.com
Fri Feb 20 04:47:56 CST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Thanks again for your work and patience! This goes in the right direction in my eyes. The full set of address tests are run against both versions, and it documents the differences between non-ex and ex better. Can you do the same with the ipv4 tests in patch 1?

Am 2015-02-19 um 23:38 schrieb Mark Jansen:
> +/* ipv6 addresses from https://github.com/beaugunderson/javascript-ipv6/tree/master/test/data */
> +static const struct
> +{
> +    PCSTR address;
> +    NTSTATUS res;
> +    int terminator_offset;
> +    int ip[8];
> +    int broken;
What is the meaning of broken here? Different behavior among different Windows versions? Or deviation from your source above?

> +    int ex_fails;   /* 1 means ex should fail, 2 means skip for ex */
Style hint: You can use an enum in this case.

I guess you need the skip value because the last test fails on non-ex and succeeds on ex and your expected address does not match. Similarly, the behavior that the function writes to the output address even in case of a failure isn't exactly helpful.

- From patch 3:
> +        if (ipv6_tests[i].ex_fails == 2)    /* testing vs ex doesnt >make sense. */
> +            continue;
Please document why, it took me a while to come up with the guess above. (And I'm not even sure it's the real reason). You're also not checking the output IP for the IP tests from the non-ex tests here. Is there a reason for that? Are there any cases where -Ex returns a different IP than non-ex?

> +        if (ipv6_tests[i].ip[0] == -1)
> +        {
> +            for (j = 0; j < 8; ++j)
> +                expected_ip.s6_words[j] = 0xabab;
> +        }
I guess you want to avoid writing 0xabab 8 times in the table. I don't have any objection, but I can't predict if Alexandre likes it - technically this is redundant code. I'd say keep it for now, if he doesn't like it he will tell you.

> +            for (j = 0; j < 8; ++j)
> +                expected_ip.s6_words[j] = ipv6_tests[i].ip[j];
Would this do the right thing on big endian machines?

About some individual tests:
> +    { "1111:2222:3333:4444:5555:6666:7777::",           STATUS_SUCCESS,             34, { 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0 }, 1 },
Now that's an interesting corner case. Out of curiosity, what does "1111:2222:3333:4444:5555:6666:7777:" do in non-ex and ex (one : removed)?

> +    { "::0:0:0:0:0:0:0",                                STATUS_SUCCESS,             13, { 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 1 },
> +    { "::0:a:b:c:d:e:f",                                STATUS_SUCCESS,             13, { 0, 0, 0, 0xa00, 0xb00, 0xc00, 0xd00, 0xe00 }, 0, 1 },
Here it would be interesting to know what IP -Ex writes before it fails. I don't see why -Ex would fail if -Ex calls non-ex, given that the terminator points way beyond the problematic "::" at the start. 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJU5xDbAAoJEN0/YqbEcdMwmEIP/0ti3aPWMeI8yetig2eTIuAG
2QhNad7bgFgioJBremjKPDuDJViYhkv4XoIwie6bRFSF9VnEECmiv2wObhRz2e0E
MgK1bGkZc0BXs4TiVoa/+JVxWgo3ddWn1Wpj+hyVRAvyEfj4NNfRWvcGaQ+cZmwu
Sd0tx7BqCQLSPnNwyrl53nqVWjkkmARdSF2pLDMgXkwtGXlR2b2irYslYg+Sqgvb
+ORAryKZvVLt8vL6wBclb8ruFWpro7/Rio6eZb8EfoRNH+8YdYWUrdfcoCE4Ui0i
W2xsOnahZuPvuQR9id8zp4etIa+YrlGlVsIfHZrzDzCvbyuBlq+niSeWZxgNwMs+
IUpHoHj0TYNUZ9A7PB16UPHowsPVE5GYvsdjFr4Rj8rHxQqvftpTwFxRqWuV4qkQ
Qx+achRcfA/qXWWYHksENuQJxF29vIbgiLbpvW256A6zmsAvB/+LlqndeF+BuW4I
3rQ2H7ADBAMx8IscePSDNLAKd2vsYWj8gFlw7y10HnIE7/zedqtWPIaGocFnS0u5
QR/ETfUW5uvOr4rqMcyMCxg3yhc/QvYV67LFMrLusJ1IlCBhcfAC4r2B91sECHXr
fJvdfGwL6HBt3tAJ5zxXZjTEwiFc77TGxswbt4lQplhFqTHfi/ZovGUiS/W3nQl6
vX0zFtoYLTRAK0KtCNiP
=JRkZ
-----END PGP SIGNATURE-----



More information about the wine-devel mailing list