summaryrefslogtreecommitdiff
path: root/test/lib/utils.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2007-09-22 13:32:42 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2007-09-22 13:32:42 +0000
commitf1f80696ebe87520de0c857371e0ca109fce68cb (patch)
tree66b241e6ef7384e9bed2b57b11c5d8f075601b12 /test/lib/utils.h
parentdac9bafa302a42ef8e58fa017739cc29a046413f (diff)
downloadlibdom-f1f80696ebe87520de0c857371e0ca109fce68cb.tar.gz
libdom-f1f80696ebe87520de0c857371e0ca109fce68cb.tar.bz2
Create a library of utility functions for the testsuite to use
Make test/binding.c include stdio.h itself rather than relying on other things to include it. svn path=/trunk/dom/; revision=3568
Diffstat (limited to 'test/lib/utils.h')
-rw-r--r--test/lib/utils.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/lib/utils.h b/test/lib/utils.h
new file mode 100644
index 0000000..b57db36
--- /dev/null
+++ b/test/lib/utils.h
@@ -0,0 +1,35 @@
+/*
+ * This file is part of libdom test suite.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org>
+ */
+
+#ifndef utils_h_
+#define utils_h_
+
+#include <stddef.h>
+#include <inttypes.h>
+
+#ifndef max
+#define max(a,b) ((a)>(b)?(a):(b))
+#endif
+
+#ifndef min
+#define min(a,b) ((a)<(b)?(a):(b))
+#endif
+
+#ifndef SLEN
+/* Calculate length of a string constant */
+#define SLEN(s) (sizeof((s)) - 1) /* -1 for '\0' */
+#endif
+
+#ifndef UNUSED
+#define UNUSED(x) ((x) = (x))
+#endif
+
+void *myrealloc(void *ptr, size_t len, void *pw);
+void mymsg(uint32_t severity, void *ctx, const char *msg, ...);
+
+#endif
+