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