blob: df103af366b0dd8f5b96fdf9448fff17b0ee65b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
/*
* Copyright 2023 jacqueline <me@jacqueline.id.au>
*
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "drivers/adc.hpp"
#include <cstdint>
#include "catch2/catch.hpp"
namespace drivers {
TEST_CASE("battery measurement", "[integration]") {
AdcBattery battery;
SECTION("voltage is within range") {
uint32_t mv = battery.Millivolts();
REQUIRE(mv <= 4210); // Should never be charged above this.
REQUIRE(mv >= 3000); // Should never be discharged below this.
}
}
} // namespace drivers
|