Commit 56f96c17 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

ntdll/tests: Add more tests for RtlIpv4StringToAddress.

parent 3c8f70e2
......@@ -1212,12 +1212,23 @@ static struct
{ "1", STATUS_SUCCESS, 1, { 0, 0, 0, 1 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 1, { -1 } },
{ "-1", STATUS_INVALID_PARAMETER, 0, { -1 } },
{ "1.2", STATUS_SUCCESS, 3, { 1, 0, 0, 2 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 3, { -1 } },
{ "1000.2000", STATUS_INVALID_PARAMETER, 9, { -1 } },
{ "1.2.", STATUS_INVALID_PARAMETER, 4, { -1 } },
{ "1..2", STATUS_INVALID_PARAMETER, 3, { -1 } },
{ "1...2", STATUS_INVALID_PARAMETER, 3, { -1 } },
{ "1.2.3", STATUS_SUCCESS, 5, { 1, 2, 0, 3 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 5, { -1 } },
{ "1.2.3.", STATUS_INVALID_PARAMETER, 6, { -1 } },
{ "203569230", STATUS_SUCCESS, 9, { 12, 34, 56, 78 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 9, { -1 } },
{ "1.223756", STATUS_SUCCESS, 8, { 1, 3, 106, 12 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 8, { -1 } },
{ "3.4.756", STATUS_SUCCESS, 7, { 3, 4, 2, 244 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 7, { -1 } },
{ "756.3.4", STATUS_INVALID_PARAMETER, 7, { -1 } },
{ "3.756.4", STATUS_INVALID_PARAMETER, 7, { -1 } },
{ "3.4.756.1", STATUS_INVALID_PARAMETER, 9, { -1 } },
{ "3.4.65536", STATUS_INVALID_PARAMETER, 9, { -1 } },
{ "3.4.5.6.7", STATUS_INVALID_PARAMETER, 7, { -1 } },
......@@ -1233,9 +1244,27 @@ static struct
{ ".1", STATUS_INVALID_PARAMETER, 1, { -1 } },
{ ".1.", STATUS_INVALID_PARAMETER, 1, { -1 } },
{ ".1.2.3", STATUS_INVALID_PARAMETER, 1, { -1 } },
{ ".1.2.3.4", STATUS_INVALID_PARAMETER, 1, { -1 } },
{ "0.1.2.3", STATUS_SUCCESS, 7, { 0, 1, 2, 3 } },
{ "0.1.2.3.", STATUS_INVALID_PARAMETER, 7, { -1 } },
{ "[0.1.2.3]", STATUS_INVALID_PARAMETER, 0, { -1 } },
{ "0x00010203", STATUS_SUCCESS, 10, { 0, 1, 2, 3 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 2, { -1 } },
{ "0X00010203", STATUS_SUCCESS, 10, { 0, 1, 2, 3 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 2, { -1 } },
{ "0x1234", STATUS_SUCCESS, 6, { 0, 0, 18, 52 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 2, { -1 } },
{ "0x123456789", STATUS_SUCCESS, 11, { 35, 69, 103, 137 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 2, { -1 } },
{ "0x00010Q03", STATUS_SUCCESS, 7, { 0, 0, 0, 16 }, strict_diff_4 | ex_fail_4,
STATUS_INVALID_PARAMETER, 2, { -1 } },
{ "x00010203", STATUS_INVALID_PARAMETER, 0, { -1 } },
{ "1234BEEF", STATUS_SUCCESS, 4, { 0, 0, 4, 210 }, strict_diff_4 | ex_fail_4,
STATUS_INVALID_PARAMETER, 4, { -1 } },
{ "017700000001", STATUS_SUCCESS, 12, { 127, 0, 0, 1 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 1, { -1 } },
{ "0777", STATUS_SUCCESS, 4, { 0, 0, 1, 255 }, strict_diff_4,
STATUS_INVALID_PARAMETER, 1, { -1 } },
{ "::1", STATUS_INVALID_PARAMETER, 0, { -1 } },
{ ":1", STATUS_INVALID_PARAMETER, 0, { -1 } },
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment