From 4fbecddd847e7adffff8843cdf93f4c68f44309a Mon Sep 17 00:00:00 2001 From: Jeremy Bettis Date: Wed, 26 Oct 2022 11:29:11 -0600 Subject: zephyr: Bring qcom.c test coverage to 100% Test the final lines in qcom.c. Make battery_is_present() test mockable. Change gpio_pmic_resin_l to be input|output so that it can be read. The gpio_emul is strict and doesn't allow reading output gpios. Add gpio_switchcap_pg, instead of using the output gpio as the input power-good-pin. Remove most all of the gpio device pointers, since all the gpios are on the same port. test_chipset_reset_success stopped working because the callback on pmic_resin_l wasn't getting called. Set the interrupt flags to fix. In test_power_button wait to set power_good until after pmic_kpd_pwr_odl is set. This is slightly more realistic. Add 2 more failures cases in power on sequence. Exclude an unreachable line from lcov. BRANCH=None BUG=None TEST=./twister Signed-off-by: Jeremy Bettis Change-Id: Ie38f53addfbc745e046f017f322dada4486405ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3994229 Commit-Queue: Jeremy Bettis Code-Coverage: Zoss Reviewed-by: Abe Levkoy Tested-by: Jeremy Bettis Auto-Submit: Jeremy Bettis --- power/qcom.c | 1 - 1 file changed, 1 deletion(-) (limited to 'power') diff --git a/power/qcom.c b/power/qcom.c index 30374cd330..eba2d32442 100644 --- a/power/qcom.c +++ b/power/qcom.c @@ -1139,7 +1139,6 @@ test_mockable enum power_state power_handle_state(enum power_state state) default: CPRINTS("Unexpected power state %d", state); ASSERT(0); - break; } return state; -- cgit v1.2.1