summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2018-02-08 15:23:28 +0100
committerchrome-bot <chrome-bot@chromium.org>2018-02-09 05:24:46 -0800
commit4ee04e1c4a978b49e5340e475e3db185e78e4949 (patch)
tree57c6e1b7af39a254fdad33eefcd768cd6a98803b
parentff4d22819a8cccaae7bec08a973916f39154f3b2 (diff)
downloadchrome-ec-4ee04e1c4a978b49e5340e475e3db185e78e4949.tar.gz
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 <vpalatin@chromium.org> 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 <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r--common/shmalloc.c2
-rw-r--r--include/shared_mem.h2
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