summaryrefslogtreecommitdiff
path: root/src/drivers/test/test_dac.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2022-11-09 16:28:19 +1100
committerjacqueline <me@jacqueline.id.au>2022-11-09 16:28:19 +1100
commit37041b810fbd10aab0834a33ae1dbd9edbb8bcb9 (patch)
treebeefecd27395821204f3d11823f566f671e8a1e1 /src/drivers/test/test_dac.cpp
parent34330daadfded8e9a421ba1d7c9ef8757ab92599 (diff)
downloadtangara-fw-37041b810fbd10aab0834a33ae1dbd9edbb8bcb9.tar.gz
Add so many tests i am going to die
Diffstat (limited to 'src/drivers/test/test_dac.cpp')
-rw-r--r--src/drivers/test/test_dac.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/drivers/test/test_dac.cpp b/src/drivers/test/test_dac.cpp
new file mode 100644
index 00000000..aa7a521c
--- /dev/null
+++ b/src/drivers/test/test_dac.cpp
@@ -0,0 +1,21 @@
+#include <cstdint>
+#include "dac.hpp"
+#include "gpio-expander.hpp"
+#include "i2c.hpp"
+#include "i2c_fixture.hpp"
+
+#include "catch2/catch.hpp"
+
+namespace drivers {
+
+TEST_CASE("dac configuration", "[integration]") {
+ I2CFixture i2c;
+ GpioExpander expander;
+ std::unique_ptr<AudioDac> dac = AudioDac::create(&expander).value();
+
+ auto power_state = dac->ReadPowerState();
+
+ REQUIRE(power_state.first == true); // booted
+}
+
+} // namespace drivers