summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-05-08 15:30:56 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-11 14:04:28 +0000
commitc1b39d008cf6aa8ed53780c5b4ff1bd55951d1b4 (patch)
tree70a298079109abeaf5e95a26e3d18874f963e124 /zephyr
parenta8a46c931fbd8effe479f98d5cadb4140460f5f6 (diff)
downloadchrome-ec-c1b39d008cf6aa8ed53780c5b4ff1bd55951d1b4.tar.gz
zephyr: test: Avoid using charger_state as a variable
We have enum charge_state_v2 and used to have enum charge_state. Try to avoid using charger_state in the source except as an enum. This makes no functional change. BUG=b:218332694 TEST=CQ Change-Id: I3e53843799b7a6258cf636c11df47389b8d98123 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516190 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/test/drivers/default/src/integration/usbc/usb_20v_3a_pd_charger.c14
-rw-r--r--zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_sink.c14
-rw-r--r--zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_source.c14
3 files changed, 21 insertions, 21 deletions
diff --git a/zephyr/test/drivers/default/src/integration/usbc/usb_20v_3a_pd_charger.c b/zephyr/test/drivers/default/src/integration/usbc/usb_20v_3a_pd_charger.c
index f2afa5be9a..8b1bd1a6f1 100644
--- a/zephyr/test/drivers/default/src/integration/usbc/usb_20v_3a_pd_charger.c
+++ b/zephyr/test/drivers/default/src/integration/usbc/usb_20v_3a_pd_charger.c
@@ -166,20 +166,20 @@ ZTEST_F(usb_attach_20v_3a_pd_charger, test_disconnect_battery_not_charging)
ZTEST_F(usb_attach_20v_3a_pd_charger, test_disconnect_charge_state)
{
- struct ec_response_charge_state charge_state;
+ struct ec_response_charge_state state;
disconnect_charger_from_port(fixture);
- charge_state = host_cmd_charge_state(0);
+ state = host_cmd_charge_state(0);
- zassert_false(charge_state.get_state.ac, "AC_OK not triggered");
- zassert_equal(charge_state.get_state.chg_current, 0,
+ zassert_false(state.get_state.ac, "AC_OK not triggered");
+ zassert_equal(state.get_state.chg_current, 0,
"Max charge current expected 0mA, but was %dmA",
- charge_state.get_state.chg_current);
- zassert_equal(charge_state.get_state.chg_input_current,
+ state.get_state.chg_current);
+ zassert_equal(state.get_state.chg_input_current,
CONFIG_PLATFORM_EC_CHARGER_DEFAULT_CURRENT_LIMIT,
"Charge input current limit expected %dmA, but was %dmA",
CONFIG_PLATFORM_EC_CHARGER_DEFAULT_CURRENT_LIMIT,
- charge_state.get_state.chg_input_current);
+ state.get_state.chg_input_current);
}
ZTEST_F(usb_attach_20v_3a_pd_charger, test_disconnect_typec_status)
diff --git a/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_sink.c b/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_sink.c
index 930e393691..bff3d9661e 100644
--- a/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_sink.c
+++ b/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_sink.c
@@ -149,20 +149,20 @@ ZTEST_F(usb_attach_5v_3a_pd_sink, test_disconnect_battery_discharging)
ZTEST_F(usb_attach_5v_3a_pd_sink, test_disconnect_charge_state)
{
- struct ec_response_charge_state charge_state;
+ struct ec_response_charge_state state;
disconnect_sink_from_port(fixture->tcpci_emul);
- charge_state = host_cmd_charge_state(0);
+ state = host_cmd_charge_state(0);
- zassert_false(charge_state.get_state.ac, "AC_OK not triggered");
- zassert_equal(charge_state.get_state.chg_current, 0,
+ zassert_false(state.get_state.ac, "AC_OK not triggered");
+ zassert_equal(state.get_state.chg_current, 0,
"Max charge current expected 0mA, but was %dmA",
- charge_state.get_state.chg_current);
- zassert_equal(charge_state.get_state.chg_input_current,
+ state.get_state.chg_current);
+ zassert_equal(state.get_state.chg_input_current,
CONFIG_PLATFORM_EC_CHARGER_DEFAULT_CURRENT_LIMIT,
"Charge input current limit expected %dmA, but was %dmA",
CONFIG_PLATFORM_EC_CHARGER_DEFAULT_CURRENT_LIMIT,
- charge_state.get_state.chg_input_current);
+ state.get_state.chg_input_current);
}
ZTEST_F(usb_attach_5v_3a_pd_sink, test_disconnect_typec_status)
diff --git a/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_source.c b/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_source.c
index c23fe6ed38..252509f9ba 100644
--- a/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_source.c
+++ b/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_source.c
@@ -162,20 +162,20 @@ ZTEST_F(usb_attach_5v_3a_pd_source, test_disconnect_battery_not_charging)
ZTEST_F(usb_attach_5v_3a_pd_source, test_disconnect_charge_state)
{
- struct ec_response_charge_state charge_state;
+ struct ec_response_charge_state state;
disconnect_source_from_port(fixture->tcpci_emul, fixture->charger_emul);
- charge_state = host_cmd_charge_state(TEST_PORT);
+ state = host_cmd_charge_state(TEST_PORT);
- zassert_false(charge_state.get_state.ac, "AC_OK not triggered");
- zassert_equal(charge_state.get_state.chg_current, 0,
+ zassert_false(state.get_state.ac, "AC_OK not triggered");
+ zassert_equal(state.get_state.chg_current, 0,
"Max charge current expected 0mA, but was %dmA",
- charge_state.get_state.chg_current);
- zassert_equal(charge_state.get_state.chg_input_current,
+ state.get_state.chg_current);
+ zassert_equal(state.get_state.chg_input_current,
CONFIG_PLATFORM_EC_CHARGER_DEFAULT_CURRENT_LIMIT,
"Charge input current limit expected %dmA, but was %dmA",
CONFIG_PLATFORM_EC_CHARGER_DEFAULT_CURRENT_LIMIT,
- charge_state.get_state.chg_input_current);
+ state.get_state.chg_input_current);
}
ZTEST_F(usb_attach_5v_3a_pd_source, test_disconnect_typec_status)