commit ebe0f498d85882dca93154ef9e3fc8b6c4b7127a
parent 856d71686610e5e708ae796be1d0cd2c2c7cf579
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Tue, 11 Jan 2022 21:05:39 +0300
tests: simplified libcurl HTTP settings
Diffstat:
5 files changed, 33 insertions(+), 40 deletions(-)
diff --git a/src/testcurl/test_add_conn.c b/src/testcurl/test_add_conn.c
@@ -446,11 +446,10 @@ curlEasyInitForTest (const char *queryPath, int port, struct CBC *pcbc)
(CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT,
(long) response_timeout_val)) ||
(CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) ||
- ((oneone) ?
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_1)) :
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_0))))
+ (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
+ (oneone) ?
+ CURL_HTTP_VERSION_1_1 :
+ CURL_HTTP_VERSION_1_0)))
{
fprintf (stderr, "curl_easy_setopt() failed.\n");
_exit (99);
diff --git a/src/testcurl/test_get_close_keep_alive.c b/src/testcurl/test_get_close_keep_alive.c
@@ -422,11 +422,10 @@ curlEasyInitForTest (const char *queryPath, int port, struct CBC *pcbc,
(CURLE_OK != curl_easy_setopt (c, CURLOPT_HEADERDATA,
hdr_chk_result)) ||
(CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) ||
- ((oneone) ?
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_1)) :
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_0))))
+ (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
+ (oneone) ?
+ CURL_HTTP_VERSION_1_1 :
+ CURL_HTTP_VERSION_1_0)))
{
fprintf (stderr, "curl_easy_setopt() failed.\n");
externalErrorExit ();
diff --git a/src/testcurl/test_large_put.c b/src/testcurl/test_large_put.c
@@ -365,11 +365,11 @@ testPutInternalThread (unsigned int add_flag)
(long) 150)) ||
(CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT,
(long) 150)) ||
- ((oneone) ?
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_1)) :
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_0))))
+ (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
+ (oneone) ?
+ CURL_HTTP_VERSION_1_1 :
+ CURL_HTTP_VERSION_1_0)))
+
{
fprintf (stderr, "curl_easy_setopt() failed.\n");
externalErrorExit ();
@@ -471,11 +471,10 @@ testPutThreadPerConn (unsigned int add_flag)
(long) 150)) ||
(CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT,
(long) 150)) ||
- ((oneone) ?
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_1)) :
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_0))))
+ (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
+ (oneone) ?
+ CURL_HTTP_VERSION_1_1 :
+ CURL_HTTP_VERSION_1_0)))
{
fprintf (stderr, "curl_easy_setopt() failed.\n");
externalErrorExit ();
@@ -577,11 +576,10 @@ testPutThreadPool (unsigned int add_flag)
(long) 150)) ||
(CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT,
(long) 150)) ||
- ((oneone) ?
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_1)) :
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_0))))
+ (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
+ (oneone) ?
+ CURL_HTTP_VERSION_1_1 :
+ CURL_HTTP_VERSION_1_0)))
{
fprintf (stderr, "curl_easy_setopt() failed.\n");
externalErrorExit ();
@@ -689,11 +687,10 @@ testPutExternal (void)
(long) 150)) ||
(CURLE_OK != curl_easy_setopt (c, CURLOPT_TIMEOUT,
(long) 150)) ||
- ((oneone) ?
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_1)) :
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_0))))
+ (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
+ (oneone) ?
+ CURL_HTTP_VERSION_1_1 :
+ CURL_HTTP_VERSION_1_0)))
{
fprintf (stderr, "curl_easy_setopt() failed.\n");
externalErrorExit ();
diff --git a/src/testcurl/test_toolarge.c b/src/testcurl/test_toolarge.c
@@ -577,11 +577,10 @@ curlEasyInitForTest (const char *queryPath, const char *method,
(CURLE_OK != curl_easy_setopt (c, CURLOPT_HEADERDATA,
hdr_chk_result)) ||
(CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) ||
- ((oneone) ?
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_1)) :
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_0))))
+ (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
+ (oneone) ?
+ CURL_HTTP_VERSION_1_1 :
+ CURL_HTTP_VERSION_1_0)))
libcurlErrorExitDesc ("curl_easy_setopt() failed");
if (CURLE_OK != curl_easy_setopt (c, CURLOPT_CUSTOMREQUEST, method))
diff --git a/src/testcurl/test_tricky.c b/src/testcurl/test_tricky.c
@@ -500,11 +500,10 @@ curlEasyInitForTest (struct curlQueryParams *p,
(long) 1)) ||
#endif /* CURL_AT_LEAST_VERSION(7, 42, 0) */
(CURLE_OK != curl_easy_setopt (c, CURLOPT_FAILONERROR, 1L)) ||
- ((oneone) ?
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_1)) :
- (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_0))))
+ (CURLE_OK != curl_easy_setopt (c, CURLOPT_HTTP_VERSION,
+ (oneone) ?
+ CURL_HTTP_VERSION_1_1 :
+ CURL_HTTP_VERSION_1_0)))
libcurlErrorExitDesc ("curl_easy_setopt() failed");
if (CURLE_OK != curl_easy_setopt (c, CURLOPT_CUSTOMREQUEST, p->method))