]> granicus.if.org Git - libevent/commitdiff
test/http: add regress test for set family to AF_INET6
authorAzat Khuzhin <a3at.mail@gmail.com>
Wed, 26 Mar 2014 20:49:00 +0000 (00:49 +0400)
committerAzat Khuzhin <a3at.mail@gmail.com>
Wed, 26 Mar 2014 20:50:04 +0000 (00:50 +0400)
test/regress_http.c

index 0a015a3185683b9dc8c0dd2c50f930e7ff661a15..c5fc9dd85e5017bb0f45a96243519e9c3dafae06 100644 (file)
@@ -3641,7 +3641,7 @@ static struct regress_dns_server_table ipv6_search_table[] = {
 };
 
 static void
-http_ipv6_for_domain_test(void *arg)
+http_ipv6_for_domain_test_impl(void *arg, int family)
 {
        struct basic_test_data *data = arg;
        struct evdns_base *dns_base = NULL;
@@ -3659,13 +3659,18 @@ http_ipv6_for_domain_test(void *arg)
        evdns_base_nameserver_ip_add(dns_base, address);
 
        http_connection_test_(arg, 0 /* not persistent */, "localhost", dns_base,
-               1 /* ipv6 */, AF_UNSPEC);
+               1 /* ipv6 */, family);
 
  end:
        if (dns_base)
                evdns_base_free(dns_base, 0);
        regress_clean_dnsserver();
 }
+static void
+http_ipv6_for_domain_test(void *arg)
+{
+       http_ipv6_for_domain_test_impl(arg, AF_UNSPEC);
+}
 
 static void
 http_request_get_addr_on_close(struct evhttp_connection *evcon, void *arg)
@@ -3740,6 +3745,11 @@ http_set_family_ipv4_test(void *arg)
 {
        http_connection_test_(arg, 0, "127.0.0.1", NULL, 0, AF_INET);
 }
+static void
+http_set_family_ipv6_test(void *arg)
+{
+       http_ipv6_for_domain_test_impl(arg, AF_INET6);
+}
 
 #define HTTP_LEGACY(name)                                              \
        { #name, run_legacy_test_fn, TT_ISOLATED|TT_LEGACY, &legacy_setup, \
@@ -3794,6 +3804,7 @@ struct testcase_t http_testcases[] = {
 
        HTTP(set_family),
        HTTP(set_family_ipv4),
+       HTTP(set_family_ipv6),
 
        END_OF_TESTCASES
 };