]> granicus.if.org Git - libevent/commitdiff
test/http: avoid using conditionals with omitted operands (fixes VS2015)
authorAzat Khuzhin <a3at.mail@gmail.com>
Fri, 17 Jun 2016 13:14:02 +0000 (16:14 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Fri, 17 Jun 2016 14:04:37 +0000 (17:04 +0300)
But we need to add VS2015 build on appveyor.

Fixes: #361
Reported-by: @nntrab
test/regress_http.c

index 2b77c07f79ddab584479658d0631a9101ecaf149..178f39583725f7b63e39b2ff66784c7a841a4e5d 100644 (file)
@@ -1388,6 +1388,7 @@ http_cancel_test(void *arg)
        struct evhttp *inactive_http = NULL;
        struct event_base *inactive_base = NULL;
        struct evhttp_connection **evcons = NULL;
+       struct event_base *base_to_fill = data->base;
 
        enum http_cancel_test_type type =
                (enum http_cancel_test_type)data->setup_data;
@@ -1421,10 +1422,12 @@ http_cancel_test(void *arg)
                port = 0;
                inactive_base = event_base_new();
                inactive_http = http_setup(&port, inactive_base, 0);
+
+               base_to_fill = inactive_base;
        }
 
        if (type & SERVER_TIMEOUT)
-               evcons = http_fill_backlog(inactive_base ?: data->base, port);
+               evcons = http_fill_backlog(base_to_fill, port);
 
        evcon = evhttp_connection_base_new(
                data->base, dns_base,
@@ -1473,7 +1476,7 @@ http_cancel_test(void *arg)
 
        http_free_evcons(evcons);
        if (type & SERVER_TIMEOUT)
-               evcons = http_fill_backlog(inactive_base ?: data->base, port);
+               evcons = http_fill_backlog(base_to_fill, port);
 
        req = http_cancel_test_bad_request_new(type, data->base);
        if (!req)
@@ -1493,7 +1496,7 @@ http_cancel_test(void *arg)
 
        http_free_evcons(evcons);
        if (type & SERVER_TIMEOUT)
-               evcons = http_fill_backlog(inactive_base ?: data->base, port);
+               evcons = http_fill_backlog(base_to_fill, port);
 
        req = http_cancel_test_bad_request_new(type, data->base);
        if (!req)