summaryrefslogtreecommitdiff
path: root/src/drivers/test/test_battery.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-05-09 11:20:57 +1000
committerjacqueline <me@jacqueline.id.au>2023-05-09 11:20:57 +1000
commitd739edef761f3bf576dc45da6611279a3f68596e (patch)
tree96545a7e590583cd39fd607805985f7e87957e87 /src/drivers/test/test_battery.cpp
parent16e6180ba7946119538d03463ea7d37fccc4dcb3 (diff)
downloadtangara-fw-d739edef761f3bf576dc45da6611279a3f68596e.tar.gz
Fix tests!
Includes removing some that never passed and/or weren't quite a good idea
Diffstat (limited to 'src/drivers/test/test_battery.cpp')
-rw-r--r--src/drivers/test/test_battery.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/test/test_battery.cpp b/src/drivers/test/test_battery.cpp
index f0006336..4a52300d 100644
--- a/src/drivers/test/test_battery.cpp
+++ b/src/drivers/test/test_battery.cpp
@@ -7,12 +7,12 @@
namespace drivers {
TEST_CASE("battery measurement", "[integration]") {
- REQUIRE(drivers::init_adc() == ESP_OK);
+ Battery battery;
SECTION("voltage is within range") {
- uint32_t voltage = read_battery_voltage();
- REQUIRE(voltage <= 2200); // Plugged in, no battery.
- REQUIRE(voltage >= 1000);
+ uint32_t mv = battery.Millivolts();
+ REQUIRE(mv <= 2200); // Plugged in, no battery.
+ REQUIRE(mv >= 1000);
}
}