From d739edef761f3bf576dc45da6611279a3f68596e Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 9 May 2023 11:20:57 +1000 Subject: Fix tests! Includes removing some that never passed and/or weren't quite a good idea --- src/drivers/test/test_battery.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/drivers/test/test_battery.cpp') 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); } } -- cgit v1.2.3