summaryrefslogtreecommitdiff
path: root/test/testutils/utils.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-07 15:13:39 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-07 15:13:39 +0100
commit6f6f365c502da0cefd468755f55848301f7518e7 (patch)
tree4afd9af130ff4ab8854633d99db04b11bf50bfff /test/testutils/utils.c
parent2d8858577a5cfb5878464f4a1b94eb13231ee63a (diff)
downloadlibdom-6f6f365c502da0cefd468755f55848301f7518e7.tar.gz
libdom-6f6f365c502da0cefd468755f55848301f7518e7.tar.bz2
DOMTS: Add proper support for assertURIEquals
Diffstat (limited to 'test/testutils/utils.c')
-rw-r--r--test/testutils/utils.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/testutils/utils.c b/test/testutils/utils.c
index 739933f..c876613 100644
--- a/test/testutils/utils.c
+++ b/test/testutils/utils.c
@@ -8,6 +8,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "utils.h"
@@ -31,4 +32,10 @@ void mymsg(uint32_t severity, void *ctx, const char *msg, ...)
fprintf(stderr, "\n");
}
-
+char *domts_strndup(const char *s, size_t len)
+{
+ size_t retlen = min(strlen(s), len);
+ char *ret = calloc(retlen + 1, 1);
+ memcpy(ret, s, retlen);
+ return ret;
+}