@@ -179,19 +179,23 @@ static void test_parse_addr_port(abts_case *tc, void *data)
179
179
,{ "www.example.com:8080" , APR_SUCCESS , "www.example.com" , NULL , 8080 }
180
180
,{ "w:1" , APR_SUCCESS , "w" , NULL , 1 }
181
181
,{ "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
182
184
,{ "[::]:80" , APR_SUCCESS , "::" , NULL , 80 }
183
185
,{ "[::%eth0]:80" , APR_SUCCESS , "::" , "eth0" , 80 }
184
186
,{ "[::%eth0]" , APR_SUCCESS , "::" , "eth0" , 0 }
185
- ,{ "8080" , APR_SUCCESS , NULL , NULL , 8080 } /* API doc has this case */
187
+ #endif
186
188
187
189
/* Failure cases */
188
190
,{ "localhost:999999" , APR_EINVAL , NULL , NULL , 0 }
189
191
,{ "localhost:0" , APR_EINVAL , NULL , NULL , 0 }
192
+ #if APR_HAVE_IPV6
190
193
,{ "[abc]" , APR_EINVAL , NULL , NULL , 0 }
191
194
,{ "[::]z:80" , APR_EINVAL , NULL , NULL , 0 }
192
195
,{ "[:::80" , APR_EINVAL , NULL , NULL , 0 }
193
196
,{ "[zzzz]:80" , APR_EINVAL , NULL , NULL , 0 }
194
197
,{ "[::%]:80" , APR_EINVAL , NULL , NULL , 0 }
198
+ #endif
195
199
/* ,{ "127.0.0.1:80x", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */
196
200
/* ,{ "127.0.0.1x:80", APR_EINVAL, NULL, NULL, 0 } <- maybe should fail?, doesn't */
197
201
/* ,{ "localhost:-1", APR_EINVAL, NULL, NULL, 0 } <- should fail, doesn't */
0 commit comments