summaryrefslogtreecommitdiff
path: root/tests/libtest/lib544.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-02-05 18:07:19 +0000
committerYang Tse <yangsita@gmail.com>2010-02-05 18:07:19 +0000
commitcad9c3f55fad5da988144dc83ad76a8544a071a2 (patch)
tree9231f49bc11dfdb69b4cac9af3b1dd473d1507ad /tests/libtest/lib544.c
parent12d01bc5f72c4c0f9aabfa45628d9c4702491fb0 (diff)
downloadcurl-cad9c3f55fad5da988144dc83ad76a8544a071a2.tar.gz
Addes OOM handling for curl_easy_setopt() calls in test
Diffstat (limited to 'tests/libtest/lib544.c')
-rw-r--r--tests/libtest/lib544.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/libtest/lib544.c b/tests/libtest/lib544.c
index b17e64af2..3229fdad3 100644
--- a/tests/libtest/lib544.c
+++ b/tests/libtest/lib544.c
@@ -40,16 +40,16 @@ int test(char *URL)
}
/* First set the URL that is about to receive our POST. */
- curl_easy_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_URL, URL);
#ifdef LIB545
- curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof teststring - 1);
+ test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof teststring - 1);
#endif
- curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, teststring);
+ test_setopt(curl, CURLOPT_COPYPOSTFIELDS, teststring);
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
- curl_easy_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
+ test_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
+ test_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
/* Update the original data to detect non-copy. */
strcpy(teststring, "FAIL");
@@ -57,6 +57,8 @@ int test(char *URL)
/* Now, this is a POST request with binary 0 embedded in POST data. */
res = curl_easy_perform(curl);
+test_cleanup:
+
/* always cleanup */
curl_easy_cleanup(curl);
curl_global_cleanup();