summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Michalec <tm@semihalf.com>2022-07-19 12:23:01 +0200
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-20 08:08:40 +0000
commit56163699ea38cbfb64916b629327ca001402a7e0 (patch)
tree817736e0749a90c945f5d4b9cc80ba3df5210515
parent549fefc0999993e50237de5c80b6fe385f4fa91a (diff)
downloadchrome-ec-56163699ea38cbfb64916b629327ca001402a7e0.tar.gz
zephyr: tests: Call PS8xxx init before each test
Product ID in PS8xxx driver is cached on init. To effectively change product ID, test has to call init function after setting product ID in emulator. BUG=b:239513456 TEST=zmake -D test test-drivers BRANCH=None Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I7f8f6663102146e23edc5672900291997ab08c09 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3773855 Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Yuval Peress <peress@google.com>
-rw-r--r--zephyr/test/drivers/src/ps8xxx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/zephyr/test/drivers/src/ps8xxx.c b/zephyr/test/drivers/src/ps8xxx.c
index 9832c53ce0..dd6f662bfe 100644
--- a/zephyr/test/drivers/src/ps8xxx.c
+++ b/zephyr/test/drivers/src/ps8xxx.c
@@ -1222,6 +1222,7 @@ static void ps8805_before(void *state)
board_set_ps8xxx_product_id(PS8805_PRODUCT_ID);
ps8xxx_emul_set_product_id(ps8xxx_emul, PS8805_PRODUCT_ID);
setup_no_fail_all();
+ zassume_equal(EC_SUCCESS, ps8xxx_tcpm_drv.init(USBC_PORT_C1), NULL);
}
static void ps8805_after(void *state)
@@ -1245,6 +1246,7 @@ static void ps8815_before(void *state)
board_set_ps8xxx_product_id(PS8815_PRODUCT_ID);
ps8xxx_emul_set_product_id(ps8xxx_emul, PS8815_PRODUCT_ID);
setup_no_fail_all();
+ zassume_equal(EC_SUCCESS, ps8xxx_tcpm_drv.init(USBC_PORT_C1), NULL);
}
static void ps8815_after(void *state)