diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2019-03-19 20:34:36 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2019-03-19 20:34:36 +0000 |
commit | 5fb101627f76f2b277371a8ec1a414a504bb14a0 (patch) | |
tree | b10b76f847a2c156918fa4179c1e4633ec9c8cdd | |
parent | 661e17ecb30150f8fc48be4bbf0516dff27e7d20 (diff) | |
download | libapr-5fb101627f76f2b277371a8ec1a414a504bb14a0.tar.gz |
Fix IPv4-only parsing tests, proposed as git pull req #15 by manusfreedom.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1855867 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | test/testipsub.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/testipsub.c b/test/testipsub.c index 7bdb8ccb4..1182d7a47 100644 --- a/test/testipsub.c +++ b/test/testipsub.c @@ -179,19 +179,23 @@ static void test_parse_addr_port(abts_case *tc, void *data) ,{ "www.example.com:8080", APR_SUCCESS, "www.example.com", NULL, 8080 } ,{ "w:1", APR_SUCCESS, "w", NULL, 1 } ,{ "127.0.0.1:80", APR_SUCCESS, "127.0.0.1", NULL, 80 } + ,{ "8080", APR_SUCCESS, NULL, NULL, 8080 } /* API doc has this case */ +#if APR_HAVE_IPV6 ,{ "[::]:80", APR_SUCCESS, "::", NULL, 80 } ,{ "[::%eth0]:80", APR_SUCCESS, "::", "eth0", 80 } ,{ "[::%eth0]", APR_SUCCESS, "::", "eth0", 0 } - ,{ "8080", APR_SUCCESS, NULL, NULL, 8080 } /* API doc has this case */ +#endif /* Failure cases */ ,{ "localhost:999999", APR_EINVAL, NULL, NULL, 0 } ,{ "localhost:0", APR_EINVAL, NULL, NULL, 0 } +#if APR_HAVE_IPV6 ,{ "[abc]", APR_EINVAL, NULL, NULL, 0 } ,{ "[::]z:80", APR_EINVAL, NULL, NULL, 0 } ,{ "[:::80", APR_EINVAL, NULL, NULL, 0 } ,{ "[zzzz]:80", APR_EINVAL, NULL, NULL, 0 } ,{ "[::%]:80", APR_EINVAL, NULL, NULL, 0 } +#endif /* ,{ "127.0.0.1:80x", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */ /* ,{ "127.0.0.1x:80", APR_EINVAL, NULL, NULL, 0 } <- maybe should fail?, doesn't */ /* ,{ "localhost:-1", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */ |