From 4ee04e1c4a978b49e5340e475e3db185e78e4949 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Thu, 8 Feb 2018 15:23:28 +0100 Subject: Fix shmalloc unit test We want to build the shmalloc common code in test mode *only* for the shmalloc test not for all test binaries (which are missing the helper functions). The previous version was broken for any board declaring CONFIG_SHMALLOC (but none were excepted cr50 which has tests disabled) Signed-off-by: Vincent Palatin BRANCH=none BUG=b:72360575 TEST=emerge-meowth chromeos-ec Change-Id: Ic89c74569fbadbc75d9090b084adab8f40ddfa5d Reviewed-on: https://chromium-review.googlesource.com/909210 Commit-Ready: Vincent Palatin Tested-by: Vincent Palatin Reviewed-by: Randall Spangler Reviewed-by: Vadim Bendebury --- common/shmalloc.c | 2 +- include/shared_mem.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/shmalloc.c b/common/shmalloc.c index 6d3d4c728f..fc9fed16c7 100644 --- a/common/shmalloc.c +++ b/common/shmalloc.c @@ -17,7 +17,7 @@ static struct mutex shmem_lock; -#ifndef TEST_BUILD +#ifndef TEST_SHMALLOC #define set_map_bit(x) #define TEST_GLOBAL static #else diff --git a/include/shared_mem.h b/include/shared_mem.h index b99cdb1341..f69730b311 100644 --- a/include/shared_mem.h +++ b/include/shared_mem.h @@ -58,7 +58,7 @@ struct shm_buffer { size_t buffer_size; }; -#ifdef TEST_BUILD +#ifdef TEST_SHMALLOC /* * When in test mode, all possible paths in the allocation/free functions set -- cgit v1.2.1