summaryrefslogtreecommitdiff
path: root/unittests/unittest.h
diff options
context:
space:
mode:
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>2018-10-26 09:35:41 -0700
committerJens Axboe <axboe@kernel.dk>2018-10-26 10:24:21 -0600
commite37155efe2b60fe0acc5051e774d2eb49e4b7ca7 (patch)
tree1b75ab56cd8232e57ac09fffdc49fe34d80e6577 /unittests/unittest.h
parentb8b0e1eea7780a02ff67f0caeba446cc403f1b37 (diff)
downloadfio-e37155efe2b60fe0acc5051e774d2eb49e4b7ca7.tar.gz
fio-e37155efe2b60fe0acc5051e774d2eb49e4b7ca7.tar.bz2
unittests: add unittest suite for lib/memalign.c
Add test cases for lib/memalign.c as an example of unittest. A workaround code to emulate smalloc()/sfree() was needed since 3114b675fd("fio: enable cross-thread overlap checking with processes") introduced dependency on smalloc()/sfree() which has dependency on fio code. Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'unittests/unittest.h')
-rw-r--r--unittests/unittest.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/unittests/unittest.h b/unittests/unittest.h
index 4ac6366b..5d170af7 100644
--- a/unittests/unittest.h
+++ b/unittests/unittest.h
@@ -1,6 +1,8 @@
#ifndef FIO_UNITTEST_H
#define FIO_UNITTEST_H
+#include <sys/types.h>
+
#include <CUnit/CUnit.h>
#include <CUnit/Basic.h>
@@ -9,7 +11,13 @@ struct fio_unittest_entry {
CU_TestFunc fn;
};
+/* XXX workaround lib/memalign.c's dependency on smalloc.c */
+void *smalloc(size_t);
+void sfree(void*);
+
CU_ErrorCode fio_unittest_add_suite(const char*, CU_InitializeFunc,
CU_CleanupFunc, struct fio_unittest_entry*);
+CU_ErrorCode fio_unittest_lib_memalign(void);
+
#endif