diff options
Diffstat (limited to 'tests/unit/unit1605.c')
-rw-r--r-- | tests/unit/unit1605.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/unit/unit1605.c b/tests/unit/unit1605.c index 2fe3a5aca..57a9199c5 100644 --- a/tests/unit/unit1605.c +++ b/tests/unit/unit1605.c @@ -23,21 +23,28 @@ #include "llist.h" +static CURL *easy; + static CURLcode unit_setup(void) { - return CURLE_OK; + int res = CURLE_OK; + + global_init(CURL_GLOBAL_ALL); + easy = curl_easy_init(); + if(!easy) + return CURLE_OUT_OF_MEMORY; + return res; } static void unit_stop(void) { - + curl_easy_cleanup(easy); + curl_global_cleanup(); } UNITTEST_START int len; char *esc; - CURL *easy = curl_easy_init(); - abort_unless(easy, "out of memory"); esc = curl_easy_escape(easy, "", -1); fail_unless(esc == NULL, "negative string length can't work"); @@ -45,6 +52,4 @@ UNITTEST_START esc = curl_easy_unescape(easy, "%41%41%41%41", -1, &len); fail_unless(esc == NULL, "negative string length can't work"); - curl_easy_cleanup(easy); - UNITTEST_STOP |