summaryrefslogtreecommitdiff
path: root/test/fake_battery.c
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@chromium.org>2019-10-14 14:06:05 -0600
committerCommit Bot <commit-bot@chromium.org>2019-10-16 08:42:19 +0000
commit7a4e700b6488a138d0c5c55aaa47e626d90a5299 (patch)
tree7df9a085eed09ffbcff37b4c8a09c71b5e9af0ca /test/fake_battery.c
parent2dd2eecaa743a65d8369c7799bbc1450b0d91d0e (diff)
downloadchrome-ec-7a4e700b6488a138d0c5c55aaa47e626d90a5299.tar.gz
pd: Add PE FRS unit test for new stack
BUG=none BRANCH=none TEST=make buildall -j Change-Id: I55453ddf1d1da0fdee902a33e14357716fb12c4a Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1859826 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'test/fake_battery.c')
-rw-r--r--test/fake_battery.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/fake_battery.c b/test/fake_battery.c
new file mode 100644
index 0000000000..4442300572
--- /dev/null
+++ b/test/fake_battery.c
@@ -0,0 +1,42 @@
+/* Copyright 2019 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.
+ *
+ * Fake BATTERY module.
+ */
+#include "battery.h"
+#include "common.h"
+
+int battery_design_voltage(int *voltage)
+{
+ *voltage = 0;
+ return 0;
+}
+
+enum battery_present battery_is_present(void)
+{
+ return BP_NO;
+}
+
+int battery_design_capacity(int *capacity)
+{
+ *capacity = 0;
+ return 0;
+}
+
+int battery_full_charge_capacity(int *capacity)
+{
+ *capacity = 0;
+ return 0;
+}
+
+int battery_remaining_capacity(int *capacity)
+{
+ *capacity = 0;
+ return 0;
+}
+
+int battery_status(int *status)
+{
+ return EC_ERROR_UNIMPLEMENTED;
+}