diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-05-09 11:20:57 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-05-09 11:20:57 +1000 |
| commit | d739edef761f3bf576dc45da6611279a3f68596e (patch) | |
| tree | 96545a7e590583cd39fd607805985f7e87957e87 /src/drivers/test/test_battery.cpp | |
| parent | 16e6180ba7946119538d03463ea7d37fccc4dcb3 (diff) | |
| download | tangara-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.cpp | 8 |
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); } } |
