summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2018-02-08 15:23:28 +0100
committerDaisuke Nojiri <dnojiri@chromium.org>2018-02-19 10:33:13 -0800
commitd5cb19f2932312fbfbfa91fc3c58e57ddf9dea6d (patch)
tree128279629ec67a648723639774c839dcbe251115
parent93dd9f3db7405e0dd05f614cd171bc492c4b9645 (diff)
downloadchrome-ec-d5cb19f2932312fbfbfa91fc3c58e57ddf9dea6d.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