diff options
Diffstat (limited to 'zephyr/test')
-rw-r--r-- | zephyr/test/drivers/src/ppc_sn5s330.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/zephyr/test/drivers/src/ppc_sn5s330.c b/zephyr/test/drivers/src/ppc_sn5s330.c index 78218ccae1..00e64950f6 100644 --- a/zephyr/test/drivers/src/ppc_sn5s330.c +++ b/zephyr/test/drivers/src/ppc_sn5s330.c @@ -544,6 +544,19 @@ ZTEST(ppc_sn5s330, test_set_polarity) "Polarity flags should be cleared."); } +ZTEST(ppc_sn5s330, test_set_vbus_source_current_limit_fail) +{ + struct i2c_emul *i2c_emul = sn5s330_emul_to_i2c_emul(EMUL); + int ret; + + i2c_common_emul_set_read_fail_reg(i2c_emul, SN5S330_FUNC_SET1); + + ret = sn5s330_drv.set_vbus_source_current_limit(SN5S330_PORT, + TYPEC_RP_3A0); + zassert_equal(EC_ERROR_INVAL, ret, "Expected EC_ERROR_INVAL but got %d", + ret); +} + static inline void reset_sn5s330_state(void) { struct i2c_emul *i2c_emul = sn5s330_emul_to_i2c_emul(EMUL); |