From: Azat Khuzhin Date: Fri, 17 Jun 2016 13:14:02 +0000 (+0300) Subject: test/http: avoid using conditionals with omitted operands (fixes VS2015) X-Git-Tag: release-2.1.6-beta~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a4bf294704034f6a7a962931d3028fe6c0b0ac8;p=libevent test/http: avoid using conditionals with omitted operands (fixes VS2015) But we need to add VS2015 build on appveyor. Fixes: #361 Reported-by: @nntrab --- diff --git a/test/regress_http.c b/test/regress_http.c index 2b77c07f..178f3958 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -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)