summaryrefslogtreecommitdiff
path: root/src/drivers/test/test_dac.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-06-25 15:23:51 +1000
committerjacqueline <me@jacqueline.id.au>2024-06-25 15:23:51 +1000
commit8db57d6dc5cf5c83cffd393a37ca37bc1a67f1af (patch)
tree3aab9a7757013b8915e3b048ba7d6e6e430d4ae3 /src/drivers/test/test_dac.cpp
parent2d04e13cc6498cb4b28a07ae1ce878a295b3cee4 (diff)
downloadtangara-fw-8db57d6dc5cf5c83cffd393a37ca37bc1a67f1af.tar.gz
Unbreak the tests build
Diffstat (limited to 'src/drivers/test/test_dac.cpp')
-rw-r--r--src/drivers/test/test_dac.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/drivers/test/test_dac.cpp b/src/drivers/test/test_dac.cpp
index 2269f280..11c69c14 100644
--- a/src/drivers/test/test_dac.cpp
+++ b/src/drivers/test/test_dac.cpp
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
-#include "dac.hpp"
+#include <stdint.h>
+#include "drivers/wm8523.hpp"
#include <cstdint>
@@ -16,16 +17,15 @@
namespace drivers {
-TEST_CASE("dac configuration", "[integration]") {
+TEST_CASE("dac is present", "[integration]") {
I2CFixture i2c;
- IGpios expander;
- cpp::result<AudioDac*, AudioDac::Error> dac_res = AudioDac::create(&expander);
- REQUIRE(dac_res.has_value());
- std::unique_ptr<AudioDac> dac(dac_res.value());
- auto power_state = dac->ReadPowerState();
+ SECTION("device id is correct") {
+ auto res = wm8523::ReadRegister(wm8523::Register::kReset);
- REQUIRE(power_state.first == true); // booted
+ REQUIRE(res.has_value());
+ REQUIRE(res.value() == 0x8523);
+ }
}
} // namespace drivers