diff options
author | Yang Tse <yangsita@gmail.com> | 2010-02-05 18:07:19 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-02-05 18:07:19 +0000 |
commit | cad9c3f55fad5da988144dc83ad76a8544a071a2 (patch) | |
tree | 9231f49bc11dfdb69b4cac9af3b1dd473d1507ad /tests/libtest/lib515.c | |
parent | 12d01bc5f72c4c0f9aabfa45628d9c4702491fb0 (diff) | |
download | curl-cad9c3f55fad5da988144dc83ad76a8544a071a2.tar.gz |
Addes OOM handling for curl_easy_setopt() calls in test
Diffstat (limited to 'tests/libtest/lib515.c')
-rw-r--r-- | tests/libtest/lib515.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/libtest/lib515.c b/tests/libtest/lib515.c index c85f2bed1..56ee68ead 100644 --- a/tests/libtest/lib515.c +++ b/tests/libtest/lib515.c @@ -29,15 +29,17 @@ int test(char *URL) } /* First set the URL that is about to receive our POST. */ - curl_easy_setopt(curl, CURLOPT_URL, URL); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, NULL); - curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0L); - curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */ - curl_easy_setopt(curl, CURLOPT_HEADER, 1L); /* include header */ + test_setopt(curl, CURLOPT_URL, URL); + test_setopt(curl, CURLOPT_POSTFIELDS, NULL); + test_setopt(curl, CURLOPT_POSTFIELDSIZE, 0L); + test_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */ + test_setopt(curl, CURLOPT_HEADER, 1L); /* include header */ /* Now, we should be making a zero byte POST request */ res = curl_easy_perform(curl); +test_cleanup: + /* always cleanup */ curl_easy_cleanup(curl); curl_global_cleanup(); |