summaryrefslogtreecommitdiff
path: root/src/drivers/test/test_storage.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_storage.cpp
parent2d04e13cc6498cb4b28a07ae1ce878a295b3cee4 (diff)
downloadtangara-fw-8db57d6dc5cf5c83cffd393a37ca37bc1a67f1af.tar.gz
Unbreak the tests build
Diffstat (limited to 'src/drivers/test/test_storage.cpp')
-rw-r--r--src/drivers/test/test_storage.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/drivers/test/test_storage.cpp b/src/drivers/test/test_storage.cpp
index f97a0a85..5af40052 100644
--- a/src/drivers/test/test_storage.cpp
+++ b/src/drivers/test/test_storage.cpp
@@ -22,31 +22,31 @@
namespace drivers {
-static const std::pmr::string kTestFilename = "test";
-static const std::pmr::string kTestFilePath =
- std::pmr::string(kStoragePath) + "/" + kTestFilename;
+static const std::string kTestFilename = "test";
+static const std::string kTestFilePath =
+ std::string(kStoragePath) + "/" + kTestFilename;
TEST_CASE("sd card storage", "[integration]") {
I2CFixture i2c;
SpiFixture spi;
- IGpios expander;
+ std::unique_ptr<IGpios> gpios{Gpios::Create(false)};
{
- std::unique_ptr<SdStorage> result(SdStorage::create(&expander).value());
+ std::unique_ptr<SdStorage> result(SdStorage::Create(*gpios).value());
SECTION("write to a file") {
{
std::ofstream test_file;
- test_file.open(kTestFilePath.c_str());
+ test_file.open(kTestFilePath);
test_file << "hello here is some test";
test_file.close();
}
SECTION("read from a file") {
std::ifstream test_file;
- test_file.open(kTestFilePath.c_str());
+ test_file.open(kTestFilePath);
- std::pmr::string line;
+ std::string line;
REQUIRE(std::getline(test_file, line));
REQUIRE(line == "hello here is some test");