summaryrefslogtreecommitdiff
path: root/src/drivers/test/i2c_fixture.hpp
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/i2c_fixture.hpp
parent34330daadfded8e9a421ba1d7c9ef8757ab92599 (diff)
downloadtangara-fw-37041b810fbd10aab0834a33ae1dbd9edbb8bcb9.tar.gz
Add so many tests i am going to die
Diffstat (limited to 'src/drivers/test/i2c_fixture.hpp')
-rw-r--r--src/drivers/test/i2c_fixture.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/drivers/test/i2c_fixture.hpp b/src/drivers/test/i2c_fixture.hpp
new file mode 100644
index 00000000..54794591
--- /dev/null
+++ b/src/drivers/test/i2c_fixture.hpp
@@ -0,0 +1,10 @@
+#pragma once
+
+#include "catch2/catch.hpp"
+#include "i2c.hpp"
+
+class I2CFixture {
+ public:
+ I2CFixture() { REQUIRE(drivers::init_i2c() == ESP_OK); }
+ ~I2CFixture() { drivers::deinit_i2c(); }
+};