From c817c214033481fe59f9f44c325a9092dc337d07 Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Thu, 20 Feb 2014 13:50:19 -0500 Subject: build: GlusterFS Unit Test Framework This patch will allow for developers to create unit tests for their code. Documentation has been added to the patch and is available here: doc/hacker-guide/en-US/markdown/unittest.md Also, unit tests are run when RPM is created. BUG: 1067059 Change-Id: I95cf8bb0354d4ca4ed4476a0f2385436a17d2369 Signed-off-by: Vijay Bellur Signed-off-by: Luis Pabon Reviewed-on: http://review.gluster.org/7145 Tested-by: Gluster Build System Reviewed-by: Rajesh Joseph Reviewed-by: Justin Clift Tested-by: Justin Clift --- libglusterfs/src/mem-pool.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libglusterfs/src/mem-pool.h') diff --git a/libglusterfs/src/mem-pool.h b/libglusterfs/src/mem-pool.h index 31f49f75cbb..aa6bf784363 100644 --- a/libglusterfs/src/mem-pool.h +++ b/libglusterfs/src/mem-pool.h @@ -20,6 +20,19 @@ #include #include +/* + * Need this for unit tests since inline functions + * access memory allocation and need to use the + * unit test versions + */ +#ifdef UNIT_TESTING +#include +#endif + +#define GF_MEM_HEADER_SIZE (4 + sizeof (size_t) + sizeof (xlator_t *) + 4 + 8) +#define GF_MEM_TRAILER_SIZE 8 +#define GF_MEM_HEADER_MAGIC 0xCAFEBABE +#define GF_MEM_TRAILER_MAGIC 0xBAADF00D struct mem_acct { uint32_t num_types; -- cgit