Skip to content

Commit cd19066

Browse files
committed
Fix IPv4-only parsing tests, proposed as git pull req #15 by manusfreedom.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1855868 13f79535-47bb-0310-9956-ffa450edef68
1 parent bd399ff commit cd19066

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/testipsub.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,19 +179,23 @@ static void test_parse_addr_port(abts_case *tc, void *data)
179179
,{ "www.example.com:8080", APR_SUCCESS, "www.example.com", NULL, 8080 }
180180
,{ "w:1", APR_SUCCESS, "w", NULL, 1 }
181181
,{ "127.0.0.1:80", APR_SUCCESS, "127.0.0.1", NULL, 80 }
182+
,{ "8080", APR_SUCCESS, NULL, NULL, 8080 } /* API doc has this case */
183+
#if APR_HAVE_IPV6
182184
,{ "[::]:80", APR_SUCCESS, "::", NULL, 80 }
183185
,{ "[::%eth0]:80", APR_SUCCESS, "::", "eth0", 80 }
184186
,{ "[::%eth0]", APR_SUCCESS, "::", "eth0", 0 }
185-
,{ "8080", APR_SUCCESS, NULL, NULL, 8080 } /* API doc has this case */
187+
#endif
186188

187189
/* Failure cases */
188190
,{ "localhost:999999", APR_EINVAL, NULL, NULL, 0 }
189191
,{ "localhost:0", APR_EINVAL, NULL, NULL, 0 }
192+
#if APR_HAVE_IPV6
190193
,{ "[abc]", APR_EINVAL, NULL, NULL, 0 }
191194
,{ "[::]z:80", APR_EINVAL, NULL, NULL, 0 }
192195
,{ "[:::80", APR_EINVAL, NULL, NULL, 0 }
193196
,{ "[zzzz]:80", APR_EINVAL, NULL, NULL, 0 }
194197
,{ "[::%]:80", APR_EINVAL, NULL, NULL, 0 }
198+
#endif
195199
/* ,{ "127.0.0.1:80x", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */
196200
/* ,{ "127.0.0.1x:80", APR_EINVAL, NULL, NULL, 0 } <- maybe should fail?, doesn't */
197201
/* ,{ "localhost:-1", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */

0 commit comments

Comments
 (0)