-----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.