Imported Upstream version 7.59.0
[platform/upstream/curl.git] / tests / unit / unit1396.c
index 84a5162..4dd25b4 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
  ***************************************************************************/
 #include "curlcheck.h"
 
-CURL *hnd;
+static CURL *hnd;
 
 static CURLcode unit_setup(void)
 {
-  return CURLE_OK;
+  int res = CURLE_OK;
+
+  global_init(CURL_GLOBAL_ALL);
+  return res;
 }
 
 static void unit_stop(void)
 {
   if(hnd)
     curl_easy_cleanup(hnd);
+  curl_global_cleanup();
 }
 
 struct test {
@@ -77,7 +81,7 @@ UNITTEST_START
 
   hnd = curl_easy_init();
   abort_unless(hnd != NULL, "returned NULL!");
-  for(i=0; list1[i].in; i++) {
+  for(i = 0; list1[i].in; i++) {
     int outlen;
     char *out = curl_easy_unescape(hnd,
                                    list1[i].in, list1[i].inlen,
@@ -93,7 +97,7 @@ UNITTEST_START
     curl_free(out);
   }
 
-  for(i=0; list2[i].in; i++) {
+  for(i = 0; list2[i].in; i++) {
     int outlen;
     char *out = curl_easy_escape(hnd, list2[i].in, list2[i].inlen);
     abort_unless(out != NULL, "returned NULL!");