ntdll/tests: Add more tests for RtlIpv6StringToAddress.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2020-02-24 00:39:51 -07:00 committed by Alexandre Julliard
parent f4ebe20b2b
commit 9c11de6b79
1 changed files with 64 additions and 0 deletions

View File

@ -1539,6 +1539,8 @@ static const struct
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0, 0x8888 } },
{ "1111:2222:3333:4444:5555:6666::7777:8888", STATUS_SUCCESS, 35,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0, 0x7777 }, ex_fail_6 },
{ "1111:2222:3333:4444:5555:6666:7777::8888", STATUS_SUCCESS, 36,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0 }, ex_fail_6|win_broken_6 },
{ "1111:2222:3333:4444:5555::", STATUS_SUCCESS, 26,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0 } },
{ "1111:2222:3333:4444:5555::123.123.123.123", STATUS_SUCCESS, 41,
@ -1555,8 +1557,30 @@ static const struct
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0x8800 }, ex_fail_6 },
{ "1111:2222:3333:4444:5555::0x8888", STATUS_SUCCESS, 27,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0x8888 }, ex_fail_6 },
{ "1111:2222:3333:4444:5555::0x80000000", STATUS_SUCCESS, 27,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0, 0, 0xffff }, ex_fail_6 },
{ "1111:2222:3333:4444::5555:0x012345678", STATUS_SUCCESS, 27,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0, 0, 0x5555, 0x7856 }, ex_fail_6 },
{ "1111:2222:3333:4444::5555:0x123456789", STATUS_SUCCESS, 27,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0, 0, 0x5555, 0xffff }, ex_fail_6 },
{ "1111:2222:3333:4444:5555:6666:0x12345678", STATUS_INVALID_PARAMETER, 31,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0xabab, 0xabab }, ex_fail_6 },
{ "1111:2222:3333:4444:5555:6666:7777:0x80000000", STATUS_SUCCESS, 36,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0xffff }, ex_fail_6 },
{ "1111:2222:3333:4444:5555:6666:7777:0x012345678", STATUS_SUCCESS, 36,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x7856 }, ex_fail_6 },
{ "1111:2222:3333:4444:5555:6666:7777:0x123456789", STATUS_SUCCESS, 36,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0xffff }, ex_fail_6 },
{ "111:222:333:444:555:666:777:0x123456789abcdef0", STATUS_SUCCESS, 29,
{ 0x1101, 0x2202, 0x3303, 0x4404, 0x5505, 0x6606, 0x7707, 0xffff }, ex_fail_6 },
{ "1111:2222:3333:4444:5555::08888", STATUS_INVALID_PARAMETER, 31,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0xabab, 0xabab, 0xabab } },
{ "1111:2222:3333:4444:5555::08888::", STATUS_INVALID_PARAMETER, 31,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0xabab, 0xabab, 0xabab } },
{ "1111:2222:3333:4444:5555:6666:7777:fffff:", STATUS_INVALID_PARAMETER, 40,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0xabab } },
{ "1111:2222:3333:4444:5555:6666::fffff:", STATUS_INVALID_PARAMETER, 36,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0xabab, 0xabab } },
{ "1111:2222:3333:4444:5555::fffff", STATUS_INVALID_PARAMETER, 31,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0xabab, 0xabab, 0xabab } },
{ "1111:2222:3333:4444::fffff", STATUS_INVALID_PARAMETER, 26,
@ -1672,16 +1696,24 @@ static const struct
{ -1 } },
{ "1111", STATUS_INVALID_PARAMETER, 4,
{ -1 } },
{ "0x1111", STATUS_INVALID_PARAMETER, 1,
{ -1 } },
{ "1111:22223333:4444:5555:6666:1.2.3.4", STATUS_INVALID_PARAMETER, -1,
{ 0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1111:22223333:4444:5555:6666:7777:8888", STATUS_INVALID_PARAMETER, -1,
{ 0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1111:123456789:4444:5555:6666:7777:8888", STATUS_INVALID_PARAMETER, -1,
{ 0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1111:1234567890abcdef0:4444:5555:6666:7777:888", STATUS_INVALID_PARAMETER, -1,
{ 0x1111, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1111:2222:", STATUS_INVALID_PARAMETER, 10,
{ 0x1111, 0x2222, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1111:2222:1.2.3.4", STATUS_INVALID_PARAMETER, 17,
{ 0x1111, 0x2222, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1111:2222:3333", STATUS_INVALID_PARAMETER, 14,
{ 0x1111, 0x2222, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1111:2222:3333:4444:5555:6666::1.2.3.4", STATUS_SUCCESS, 32,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0, 0x100 }, ex_fail_6 },
{ "1111:2222:3333:4444:5555:6666:7777:1.2.3.4", STATUS_SUCCESS, 36,
{ 0x1111, 0x2222, 0x3333, 0x4444, 0x5555, 0x6666, 0x7777, 0x100 }, ex_fail_6 },
{ "1111:2222:3333:4444:5555:6666:7777:8888:", STATUS_SUCCESS, 39,
@ -1702,12 +1734,30 @@ static const struct
{ 0x1111, 0, 0, 0, 0, 0, 0, 0x3333 }, ex_fail_6 },
{ "12345::6:7:8", STATUS_INVALID_PARAMETER, -1,
{ -1 } },
{ "1::001.2.3.4", STATUS_SUCCESS, 12,
{ 0x100, 0, 0, 0, 0, 0, 0x201, 0x403 } },
{ "1::1.002.3.4", STATUS_SUCCESS, 12,
{ 0x100, 0, 0, 0, 0, 0, 0x201, 0x403 } },
{ "1::0001.2.3.4", STATUS_INVALID_PARAMETER, -1,
{ 0x100, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1::1.0002.3.4", STATUS_INVALID_PARAMETER, -1,
{ 0x100, 0xab01, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1::1.2.256.4", STATUS_INVALID_PARAMETER, -1,
{ 0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1::1.2.4294967296.4", STATUS_INVALID_PARAMETER, -1,
{ 0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1::1.2.18446744073709551616.4", STATUS_INVALID_PARAMETER, -1,
{ 0x100, 0x201, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1::1.2.3.256", STATUS_INVALID_PARAMETER, 12,
{ 0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1::1.2.3.4294967296", STATUS_INVALID_PARAMETER, 19,
{ 0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1::1.2.3.18446744073709551616", STATUS_INVALID_PARAMETER, 29,
{ 0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1::1.2.3.300", STATUS_INVALID_PARAMETER, 12,
{ 0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1::1.2.3.300.", STATUS_INVALID_PARAMETER, 12,
{ 0x100, 0x201, 0xab03, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1::1.2::1", STATUS_INVALID_PARAMETER, 6,
{ 0x100, 0xab01, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "1::1.2.3.4::1", STATUS_SUCCESS, 10,
@ -1758,6 +1808,20 @@ static const struct
{ -1 } },
{ "::-1", STATUS_SUCCESS, 2,
{ 0, 0, 0, 0, 0, 0, 0, 0 }, ex_fail_6 },
{ "::12345678", STATUS_INVALID_PARAMETER, 10,
{ 0, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "::123456789", STATUS_INVALID_PARAMETER, 11,
{ 0, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "::1234567890abcdef0", STATUS_INVALID_PARAMETER, 19,
{ 0, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab } },
{ "::0x80000000", STATUS_SUCCESS, 3,
{ 0, 0, 0, 0, 0, 0, 0, 0xffff }, ex_fail_6 },
{ "::0x012345678", STATUS_SUCCESS, 3,
{ 0, 0, 0, 0, 0, 0, 0, 0x7856 }, ex_fail_6 },
{ "::0x123456789", STATUS_SUCCESS, 3,
{ 0, 0, 0, 0, 0, 0, 0, 0xffff }, ex_fail_6 },
{ "::0x1234567890abcdef0", STATUS_SUCCESS, 3,
{ 0, 0, 0, 0, 0, 0, 0, 0xffff }, ex_fail_6 },
{ "::.", STATUS_SUCCESS, 2,
{ 0, 0, 0, 0, 0, 0, 0, 0 }, ex_fail_6 },
{ "::..", STATUS_SUCCESS, 2,