summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhurima Paruchuri <mparuchuri@google.com>2023-03-09 07:28:17 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-14 15:41:26 +0000
commit4892dbb98305dbd0c5ca454450fd200bb971e6be (patch)
treec102cfa0b289cc614800764819aa7df87846c806
parent6fc59923d8f0542c2b19c0cbf6bd4089c2c126b7 (diff)
downloadchrome-ec-4892dbb98305dbd0c5ca454450fd200bb971e6be.tar.gz
rex: test: usb_pd_policy: Refactor the FFF declaration
Use FAKE_VALUE_FUNC inplace of DECLARE_FAKE_VALUE_FUNC and DEFINE_FAKE_VALUE_FUNC, as both of them are called from same file Use FAKE_VOID_FUNC inplace of DECLARE_FAKE_VOID_FUNC and DEFINE_FAKE_VOID_FUNC, as both of them are called from same file BRANCH=none BUG=none TEST=./twister -T zephyr/test -c Change-Id: I8ca62a45c53d18174248d4f0476af900674c9d8e Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4323340 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
-rw-r--r--zephyr/test/rex/src/usb_pd_policy.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/zephyr/test/rex/src/usb_pd_policy.c b/zephyr/test/rex/src/usb_pd_policy.c
index ccf41b6ef5..d49e10a495 100644
--- a/zephyr/test/rex/src/usb_pd_policy.c
+++ b/zephyr/test/rex/src/usb_pd_policy.c
@@ -13,18 +13,12 @@
#include <zephyr/fff.h>
#include <zephyr/ztest.h>
-DECLARE_FAKE_VALUE_FUNC(int, chipset_in_state, int);
-DEFINE_FAKE_VALUE_FUNC(int, chipset_in_state, int);
-DECLARE_FAKE_VALUE_FUNC(int, ppc_vbus_source_enable, int, int);
-DEFINE_FAKE_VALUE_FUNC(int, ppc_vbus_source_enable, int, int);
-DECLARE_FAKE_VOID_FUNC(pd_set_vbus_discharge, int, int);
-DEFINE_FAKE_VOID_FUNC(pd_set_vbus_discharge, int, int);
-DECLARE_FAKE_VOID_FUNC(pd_send_host_event, int);
-DEFINE_FAKE_VOID_FUNC(pd_send_host_event, int);
-DECLARE_FAKE_VALUE_FUNC(int, ppc_vbus_sink_enable, int, int);
-DEFINE_FAKE_VALUE_FUNC(int, ppc_vbus_sink_enable, int, int);
-DECLARE_FAKE_VALUE_FUNC(int, ppc_is_sourcing_vbus, int);
-DEFINE_FAKE_VALUE_FUNC(int, ppc_is_sourcing_vbus, int);
+FAKE_VALUE_FUNC(int, chipset_in_state, int);
+FAKE_VALUE_FUNC(int, ppc_vbus_source_enable, int, int);
+FAKE_VOID_FUNC(pd_set_vbus_discharge, int, int);
+FAKE_VOID_FUNC(pd_send_host_event, int);
+FAKE_VALUE_FUNC(int, ppc_vbus_sink_enable, int, int);
+FAKE_VALUE_FUNC(int, ppc_is_sourcing_vbus, int);
int chipset_in_state_mock(int state_mask)
{