aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-01-04 16:31:54 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-01-04 16:31:54 +0100
commit7af54ef9a545d277f342f9bba83597d4fe3afa3d (patch)
tree046271dda4c8dd3679b175941cc926a9d5b3186a
parent1602ed6ba1a554f36c99fcc03138f0d47faa4f4a (diff)
curlcheck.h: add verify_memory
This check verifies that a pointer contains the correct data.
-rw-r--r--tests/unit/curlcheck.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit/curlcheck.h b/tests/unit/curlcheck.h
index 524dbbce8..360afcac6 100644
--- a/tests/unit/curlcheck.h
+++ b/tests/unit/curlcheck.h
@@ -23,6 +23,13 @@
unitfail++; \
}
+#define verify_memory(dynamic, check, len) \
+ if(memcmp(dynamic, check, len)) { \
+ fprintf(stderr, "%s:%d The dynamic string didn't match '%s'\n", \
+ __FILE__, __LINE__, check); \
+ unitfail++; \
+ }
+
extern int unitfail;
#define UNITTEST_START \