aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2006-10-10 23:50:37 +0000
committerYang Tse <yangsita@gmail.com>2006-10-10 23:50:37 +0000
commit8274447dd9ad74bf179973679250175f29b174e9 (patch)
tree0764838e039baa1afbe25481c225c2ebcfcce7e0 /tests
parent083a84e5d0fda642433df6108561cc084b306f58 (diff)
Call curl_global_cleanup() in all code paths before exiting test
Diffstat (limited to 'tests')
-rw-r--r--tests/libtest/lib525.c6
-rw-r--r--tests/libtest/lib526.c4
-rw-r--r--tests/libtest/lib530.c4
-rw-r--r--tests/libtest/lib533.c4
4 files changed, 13 insertions, 5 deletions
diff --git a/tests/libtest/lib525.c b/tests/libtest/lib525.c
index 240628028..9dcddaecf 100644
--- a/tests/libtest/lib525.c
+++ b/tests/libtest/lib525.c
@@ -45,9 +45,11 @@ int test(char *URL)
/* get a curl handle */
curl = curl_easy_init();
- if(!curl)
+ if(!curl) {
+ fclose(hd_src);
+ curl_global_cleanup();
return 100; /* major bad */
-
+ }
/* enable uploading */
curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ;
diff --git a/tests/libtest/lib526.c b/tests/libtest/lib526.c
index bf16c510e..dce6a9f1b 100644
--- a/tests/libtest/lib526.c
+++ b/tests/libtest/lib526.c
@@ -51,8 +51,10 @@ int test(char *URL)
/* get NUM_HANDLES easy handles */
for(i=0; i < NUM_HANDLES; i++) {
curl[i] = curl_easy_init();
- if(!curl[i])
+ if(!curl[i]) {
+ curl_global_cleanup();
return 100 + i; /* major bad */
+ }
curl_easy_setopt(curl[i], CURLOPT_URL, URL);
/* go verbose */
diff --git a/tests/libtest/lib530.c b/tests/libtest/lib530.c
index 3e6cd3fac..d062886f4 100644
--- a/tests/libtest/lib530.c
+++ b/tests/libtest/lib530.c
@@ -32,8 +32,10 @@ int test(char *URL)
/* get NUM_HANDLES easy handles */
for(i=0; i < NUM_HANDLES; i++) {
curl[i] = curl_easy_init();
- if(!curl[i])
+ if(!curl[i]) {
+ curl_global_cleanup();
return 100 + i; /* major bad */
+ }
curl_easy_setopt(curl[i], CURLOPT_URL, URL);
/* go verbose */
diff --git a/tests/libtest/lib533.c b/tests/libtest/lib533.c
index a4b6877ef..74499c232 100644
--- a/tests/libtest/lib533.c
+++ b/tests/libtest/lib533.c
@@ -29,8 +29,10 @@ int test(char *URL)
curl_global_init(CURL_GLOBAL_ALL);
curl = curl_easy_init();
- if(!curl)
+ if(!curl) {
+ curl_global_cleanup();
return 100; /* major bad */
+ }
curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);