summaryrefslogtreecommitdiff
path: root/common/mock/tcpm_mock.c
diff options
context:
space:
mode:
authorPaul Fagerburg <pfagerburg@google.com>2020-06-18 16:32:30 -0600
committerCommit Bot <commit-bot@chromium.org>2020-06-23 02:29:14 +0000
commit01705adbfa51d14e986c76605c995b9ec2d42170 (patch)
tree3d5d7f12010d90f8f1d42222bad7ef749f2100bc /common/mock/tcpm_mock.c
parentae40ebba225fefeb802db2bdce843080eecae081 (diff)
downloadchrome-ec-01705adbfa51d14e986c76605c995b9ec2d42170.tar.gz
usb_prl: new unit test with mocks
Now that the old usb_prl unit test is under usb_prl_old, add a new unit test for usb_prl with mocks for the various subsystems that it will use. BUG=b:158608129 BRANCH=None TEST=`TEST_LIST_HOST="usb_prl_old usb_prl" make runhosttests` Signed-off-by: Paul Fagerburg <pfagerburg@google.com> Change-Id: Ie1bf9a4494cd933473caa4ceb594eddd97c277c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2252662 Tested-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'common/mock/tcpm_mock.c')
-rw-r--r--common/mock/tcpm_mock.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/common/mock/tcpm_mock.c b/common/mock/tcpm_mock.c
new file mode 100644
index 0000000000..efd07a9967
--- /dev/null
+++ b/common/mock/tcpm_mock.c
@@ -0,0 +1,22 @@
+/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+/* Mock for the TCPM interface */
+
+#include "common.h"
+#include "console.h"
+#include "memory.h"
+#include "mock/tcpm_mock.h"
+
+int tcpm_dequeue_message(int port, uint32_t *payload, int *header)
+{
+ /* TODO flesh out the mock*/
+ return 0;
+}
+
+int tcpm_has_pending_message(int port)
+{
+ /* TODO flesh out the mock*/
+ return 0;
+}