Imported Upstream version 7.40.0
[platform/upstream/curl.git] / tests / unit / unit1395.c
index 8b0b0a0..6f9fc8c 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, 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
@@ -44,7 +44,7 @@ UNITTEST_START
 
   unsigned int i;
   int fails=0;
-  struct dotdot pairs[] = {
+  const struct dotdot pairs[] = {
     { "/a/b/c/./../../g", "/a/g" },
     { "mid/content=5/../6", "mid/6" },
     { "/hello/../moo", "/moo" },
@@ -66,6 +66,7 @@ UNITTEST_START
 
   for(i=0; i < sizeof(pairs)/sizeof(pairs[0]); i++) {
     char *out = Curl_dedotdotify((char *)pairs[i].input);
+    abort_unless(out != NULL, "returned NULL!");
 
     if(strcmp(out, pairs[i].output)) {
       fprintf(stderr, "Test %d: '%s' gave '%s' instead of '%s'\n",
@@ -78,10 +79,6 @@ UNITTEST_START
     free(out);
   }
 
-  return fails;
+  fail_if(fails, "output mismatched");
 
 UNITTEST_STOP
-
-
-
-