Imported Upstream version 7.59.0
[platform/upstream/curl.git] / tests / unit / unit1605.c
index c807cb3..57a9199 100644 (file)
 
 #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
-  CURL *easy = curl_easy_init();
   int len;
   char *esc;
 
@@ -44,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