aboutsummaryrefslogtreecommitdiffstats
path: root/test.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-08-28 12:36:31 +0200
committerMattias Andrée <maandree@kth.se>2018-08-28 12:36:31 +0200
commit6fda2a0697d9d49db823e1569edf27378cf31daf (patch)
tree9c088ca8932b98a33bfe92c2300d2940b5ca8353 /test.h
parentAdd test function to all .c files (diff)
downloadlibsimple-6fda2a0697d9d49db823e1569edf27378cf31daf.tar.gz
libsimple-6fda2a0697d9d49db823e1569edf27378cf31daf.tar.bz2
libsimple-6fda2a0697d9d49db823e1569edf27378cf31daf.tar.xz
Add tests for allocation functions
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--test.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/test.h b/test.h
index e4e08f2..5281cbc 100644
--- a/test.h
+++ b/test.h
@@ -8,3 +8,23 @@
fprintf(stderr, "Failed at %s:%i: %s\n", __FILE__, __LINE__, #EXPR);\
exit(1);\
} while (0)
+
+
+struct allocinfo {
+ void *real_beginning;
+ size_t real_size;
+ size_t size;
+ size_t extent;
+ size_t alignment;
+ size_t zeroed;
+ size_t refcount;
+};
+
+
+extern size_t alloc_fail_in;
+
+
+size_t get_pagesize(void);
+size_t round_up(size_t);
+int have_custom_malloc(void); /* return 0 if run under valgrind(1) */
+struct allocinfo *get_allocinfo(void *);