diff options
author | Abe Levkoy <alevkoy@chromium.org> | 2021-11-21 12:42:04 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-23 00:39:09 +0000 |
commit | 0e05cdae341485e4508736cef9fbfdc7bca48e9b (patch) | |
tree | ca1c263cbf04ca31cdb2033709e11a29ef0c89b1 | |
parent | 996c8ffebe0f6198439fa69148b70089bc2e3281 (diff) | |
download | chrome-ec-0e05cdae341485e4508736cef9fbfdc7bca48e9b.tar.gz |
zephyr test: SYV682x: Remove sleep TODOs
Time in the test environment is simulated, so sleeps will not need to be
replaced with a different mechanism.
BUG=b:201420132
TEST=zmake configure --test zephyr/test/drivers
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: I011b9764186a130a820cbbfc15e35e4bd463c0e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3288915
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
-rw-r--r-- | zephyr/test/drivers/src/ppc.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/zephyr/test/drivers/src/ppc.c b/zephyr/test/drivers/src/ppc.c index cc07402a9d..505859a05d 100644 --- a/zephyr/test/drivers/src/ppc.c +++ b/zephyr/test/drivers/src/ppc.c @@ -53,12 +53,10 @@ static void test_ppc_syv682x_interrupt(void) /* An OC event less than 100 ms should not cause VBUS to turn off. */ syv682x_emul_set_condition(emul, SYV682X_STATUS_OC_5V, SYV682X_CONTROL_4_NONE); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(50); zassert_true(ppc_is_sourcing_vbus(syv682x_port), "PPC is not sourcing VBUS after 50 ms OC"); /* But one greater than 100 ms should. */ - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(60); zassert_false(ppc_is_sourcing_vbus(syv682x_port), "PPC is sourcing VBUS after 100 ms OC"); @@ -82,7 +80,6 @@ static void test_ppc_syv682x_interrupt(void) "Source enable failed"); syv682x_emul_set_condition(emul, SYV682X_STATUS_TSD, SYV682X_CONTROL_4_NONE); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(1); zassert_false(ppc_is_sourcing_vbus(syv682x_port), "PPC is sourcing power after TSD"); @@ -94,7 +91,6 @@ static void test_ppc_syv682x_interrupt(void) "Source enable failed"); syv682x_emul_set_condition(emul, SYV682X_STATUS_OVP, SYV682X_CONTROL_4_NONE); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(1); zassert_false(ppc_is_sourcing_vbus(syv682x_port), "PPC is sourcing power after OVP"); @@ -110,7 +106,6 @@ static void test_ppc_syv682x_interrupt(void) "Sink enable failed"); syv682x_emul_set_condition(emul, SYV682X_STATUS_OC_HV, SYV682X_CONTROL_4_NONE); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(1); zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_1_REG, ®), "Reading CONTROL_1 failed"); @@ -118,7 +113,6 @@ static void test_ppc_syv682x_interrupt(void) "Power path disabled after HV_OC handled"); syv682x_emul_set_condition(emul, SYV682X_STATUS_OC_HV, SYV682X_CONTROL_4_NONE); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(1); zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_1_REG, ®), "Reading CONTROL_1 failed"); @@ -126,7 +120,6 @@ static void test_ppc_syv682x_interrupt(void) "Power path disabled after HV_OC handled"); syv682x_emul_set_condition(emul, SYV682X_STATUS_OC_HV, SYV682X_CONTROL_4_NONE); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(1); zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_1_REG, ®), "Reading CONTROL_1 failed"); @@ -143,16 +136,13 @@ static void test_ppc_syv682x_interrupt(void) ppc_set_vconn(syv682x_port, true); syv682x_emul_set_condition(emul, SYV682X_STATUS_NONE, SYV682X_CONTROL_4_VCONN_OCP); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(1); zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_4_REG, ®), "Reading CONTROL_4 failed"); zassert_true(reg & (SYV682X_CONTROL_4_VCONN1 | SYV682X_CONTROL_4_VCONN2), "VCONN disabled after initial VCONN OC"); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(50); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_4_REG, ®), "Reading CONTROL_4 failed"); zassert_true(reg & @@ -162,9 +152,7 @@ static void test_ppc_syv682x_interrupt(void) * But if the event keeps going for over 100 ms continuously, the driver * should turn VCONN off. */ - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(60); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_4_REG, ®), "Reading CONTROL_4 failed"); zassert_false(reg & @@ -182,7 +170,6 @@ static void test_ppc_syv682x_interrupt(void) ppc_set_vconn(syv682x_port, true); syv682x_emul_set_condition(emul, SYV682X_STATUS_NONE, SYV682X_CONTROL_4_VBAT_OVP); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(1); zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_4_REG, ®), "Reading CONTROL_4 failed"); @@ -254,7 +241,6 @@ static void test_ppc_syv682x_frs(void) */ syv682x_emul_set_condition(emul, SYV682X_STATUS_FRS, SYV682X_CONTROL_4_NONE); - /* TODO(b/201420132): Simulate passage of time instead of sleeping. */ msleep(1); zassert_true(ppc_is_sourcing_vbus(syv682x_port), "PPC is not sourcing VBUS after FRS signal handled"); |