summaryrefslogtreecommitdiff
path: root/test/testutils.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/testutils.h')
-rw-r--r--test/testutils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/testutils.h b/test/testutils.h
index 45870f9..7a8eda5 100644
--- a/test/testutils.h
+++ b/test/testutils.h
@@ -10,6 +10,18 @@
#define UNUSED(x) ((x) = (x))
#endif
+#ifndef LEN
+uint32_t string_length(const char *str);
+uint32_t string_length(const char *str)
+{
+ if(str == NULL)
+ return 0;
+ return strlen(str);
+}
+#define LEN(x) string_length(x)
+#endif
+
+
/* Redefine assert, so we can simply use the standard assert mechanism
* within testcases and exit with the right output for the testrunner
* to do the right thing. */