summaryrefslogtreecommitdiff
path: root/zephyr/emul/emul_isl923x.c
diff options
context:
space:
mode:
authorYuval Peress <peress@google.com>2021-10-03 23:54:53 -0600
committerCommit Bot <commit-bot@chromium.org>2021-10-05 14:24:11 +0000
commit7399d82bc7183de1f881677f0ba05738fd650e03 (patch)
treeb4e1b98b63acdd5f49ac3ac50ed25b1d7192c89f /zephyr/emul/emul_isl923x.c
parent021f2754aa8722288cff2362c470a82ef352436b (diff)
downloadchrome-ec-7399d82bc7183de1f881677f0ba05738fd650e03.tar.gz
zephyr: test: isl923x::init
Test the remaining (failure/uncommon) code paths in init(). This includes a mocking of the system_jumped_late function which was already stubbed to always return false. This mock will later need to be cleaned up with a better mock to avoid the custom struct added. BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I1be53b0a15850d8b97b7b5a96ccef764f0782816 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3201916 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'zephyr/emul/emul_isl923x.c')
-rw-r--r--zephyr/emul/emul_isl923x.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/zephyr/emul/emul_isl923x.c b/zephyr/emul/emul_isl923x.c
index 9b3aaec4f5..e7a286e6fb 100644
--- a/zephyr/emul/emul_isl923x.c
+++ b/zephyr/emul/emul_isl923x.c
@@ -105,6 +105,15 @@ struct i2c_emul *isl923x_emul_get_i2c_emul(const struct emul *emulator)
return &(data->common.emul);
}
+void isl923x_emul_reset(const struct emul *emulator)
+{
+ struct isl923x_emul_data *data = emulator->data;
+ struct i2c_common_emul_data common_backup = data->common;
+
+ memset(data, 0, sizeof(struct isl923x_emul_data));
+ data->common = common_backup;
+}
+
void isl923x_emul_set_manufacturer_id(const struct emul *emulator,
uint16_t manufacturer_id)
{