diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/test579 | 11 | ||||
-rw-r--r-- | tests/data/test599 | 6 | ||||
-rw-r--r-- | tests/libtest/lib599.c | 12 |
3 files changed, 21 insertions, 8 deletions
diff --git a/tests/data/test579 b/tests/data/test579 index adbb3dd22..e352e3d60 100644 --- a/tests/data/test579 +++ b/tests/data/test579 @@ -77,12 +77,11 @@ http://%HOSTIP:%HTTPPORT/579 log/ip579 <verify> <file name="log/ip579"> Progress callback called with UL 0 out of 0 -Progress callback called with UL 0 out of -1 -Progress callback called with UL 8 out of -1 -Progress callback called with UL 16 out of -1 -Progress callback called with UL 26 out of -1 -Progress callback called with UL 61 out of -1 -Progress callback called with UL 66 out of -1 +Progress callback called with UL 8 out of 0 +Progress callback called with UL 16 out of 0 +Progress callback called with UL 26 out of 0 +Progress callback called with UL 61 out of 0 +Progress callback called with UL 66 out of 0 </file> </verify> </testcase> diff --git a/tests/data/test599 b/tests/data/test599 index c57fe5c91..9ce8b234c 100644 --- a/tests/data/test599 +++ b/tests/data/test599 @@ -71,13 +71,15 @@ lib599 HTTP GET with progress callback and redirects changing content sizes </name> <command> -http://%HOSTIP:%HTTPPORT/599 +http://%HOSTIP:%HTTPPORT/599 log/ip599 </command> </client> # # Verify data after the test has been "shot" <verify> - +<file name="log/ip599"> +CL: -1 +</file> </verify> </testcase> diff --git a/tests/libtest/lib599.c b/tests/libtest/lib599.c index 6b092677a..08c536c72 100644 --- a/tests/libtest/lib599.c +++ b/tests/libtest/lib599.c @@ -43,6 +43,7 @@ int test(char *URL) { CURL *curl; CURLcode res=CURLE_OK; + double content_length = 0.0; if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); @@ -74,6 +75,17 @@ int test(char *URL) /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); + if (!res) { + FILE *moo; + res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, + &content_length); + moo = fopen(libtest_arg2, "wb"); + if (moo) { + fprintf(moo, "CL: %.0f\n", content_length); + fclose(moo); + } + } + test_cleanup: /* always cleanup */ |