Imported Upstream version 7.48.0
[platform/upstream/curl.git] / tests / unit / curlcheck.h
index 96203e0..22f05c1 100644 (file)
@@ -5,11 +5,11 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2015, 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
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
  *
  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  * copies of the Software, and permit persons to whom the Software is
     unitfail++;                                          \
   }
 
-#define verify_memory(dynamic, check, len)                              \
-  if(dynamic && memcmp(dynamic, check, len)) {                          \
-    fprintf(stderr, "%s:%d The dynamic string didn't match '%s'\n",     \
-            __FILE__, __LINE__, check);                                 \
-    unitfail++;                                                         \
+#define verify_memory(dynamic, check, len)                                  \
+  if(dynamic && memcmp(dynamic, check, len)) {                              \
+    fprintf(stderr, "%s:%d Memory buffer mismatch size %d. '%s' is not\n", \
+            __FILE__, __LINE__, len, hexdump((unsigned char *)check, len));      \
+    fprintf(stderr, "%s:%d the same as '%s'\n",                             \
+            __FILE__, __LINE__, hexdump((unsigned char *)dynamic, len));         \
+    unitfail++;                                                             \
   }
 
 /* fail() is for when the test case figured out by itself that a check