diff options
author | Aaron Massey <aaronmassey@google.com> | 2021-11-05 11:40:02 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-18 18:46:30 +0000 |
commit | 83996631e462199a4e03116e0cdb790856c8efb5 (patch) | |
tree | 8beb9d0a78afd62ea559541152e08088e8af40e2 /zephyr/test/drivers/src/ppc_sn5s330.c | |
parent | 2c71cfba6e25e7c07ea10c12309aaaf6a7261e4e (diff) | |
download | chrome-ec-83996631e462199a4e03116e0cdb790856c8efb5.tar.gz |
zephyr: emul: Add sn5s330 emul reset
Add sn5s330 emulator reset for isolated unit testing.
BRANCH=none
BUG=b:203364783
TEST=zmake configure --test zephyr/test/drivers
Signed-off-by: Aaron Massey <aaronmassey@google.com>
Change-Id: Ideb77c295e0ec0808656881c020f1a18e7428d08
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3271366
Reviewed-by: Yuval Peress <peress@google.com>
Diffstat (limited to 'zephyr/test/drivers/src/ppc_sn5s330.c')
-rw-r--r-- | zephyr/test/drivers/src/ppc_sn5s330.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/zephyr/test/drivers/src/ppc_sn5s330.c b/zephyr/test/drivers/src/ppc_sn5s330.c index 3cabfc43c9..95556e28cf 100644 --- a/zephyr/test/drivers/src/ppc_sn5s330.c +++ b/zephyr/test/drivers/src/ppc_sn5s330.c @@ -53,10 +53,16 @@ static void test_fail_once_func_set1(void) i2c_common_emul_set_write_func(i2c_emul, NULL, NULL); } +static void reset_sn5s330_state(void) +{ + sn5s330_emul_reset(EMUL); +} + void test_suite_ppc_sn5s330(void) { - ztest_test_suite( - ppc_sn5s330, - ztest_unit_test(test_fail_once_func_set1)); + ztest_test_suite(ppc_sn5s330, + ztest_unit_test_setup_teardown( + test_fail_once_func_set1, reset_sn5s330_state, + reset_sn5s330_state)); ztest_run_test_suite(ppc_sn5s330); } |