summaryrefslogtreecommitdiff
path: root/test/utils.c
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-05-08 00:21:03 +0800
committerChromeBot <chrome-bot@google.com>2013-05-07 16:02:30 -0700
commit0d99eadd7783a8b0a76241f36e3b2911526a7c8c (patch)
tree261b79811c08d480f6d72509c1d116cb6dd0dacc /test/utils.c
parent0a45fa17086d4556b7cb4ea0a9f53894197bc897 (diff)
downloadchrome-ec-0d99eadd7783a8b0a76241f36e3b2911526a7c8c.tar.gz
Add persistent storage for emulator
This is needed for non-volatile register emulation. Also, this can be used to implement system jump or reset flags. BUG=chrome-os-partner:19235 TEST=Run utils test. Check persistent storage file exists. BRANCH=None Change-Id: I699f95718ef6f5de6c3bbb4e37619ee015fb6c4a Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/50313 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'test/utils.c')
-rw-r--r--test/utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/utils.c b/test/utils.c
index 559e8a0d94..81fe2ef072 100644
--- a/test/utils.c
+++ b/test/utils.c
@@ -8,6 +8,7 @@
#include "common.h"
#include "console.h"
#include "shared_mem.h"
+#include "system.h"
#include "timer.h"
#include "util.h"
@@ -100,6 +101,14 @@ static int test_shared_mem(void)
return EC_SUCCESS;
}
+static int test_scratchpad(void)
+{
+ system_set_scratchpad(0xfeedfeed);
+ TEST_ASSERT(system_get_scratchpad() == 0xfeedfeed);
+
+ return EC_SUCCESS;
+}
+
void run_test(void)
{
error_count = 0;
@@ -110,6 +119,7 @@ void run_test(void)
RUN_TEST(test_atoi);
RUN_TEST(test_uint64divmod);
RUN_TEST(test_shared_mem);
+ RUN_TEST(test_scratchpad);
if (error_count)
ccprintf("Failed %d tests!\n", error_count);