Skip to content

Commit

Permalink
Adjust fram test
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilchmela committed Sep 16, 2024
1 parent ebd09f5 commit 5fcbb4d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Tests/UnitTests/Fram.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <Sts1CobcSw/Periphery/FramMock.hpp>
#include <Sts1CobcSw/Serial/Byte.hpp>
#include <Sts1CobcSw/Utility/Span.hpp>
#include <Sts1CobcSw/Utility/Time.hpp>

#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
Expand All @@ -18,6 +19,7 @@ namespace fram = sts1cobcsw::fram;
using sts1cobcsw::Byte;
using sts1cobcsw::Span;
using sts1cobcsw::operator""_b; // NOLINT(misc-unused-using-decls)
using sts1cobcsw::s;


auto WriteAndReadTestData(sts1cobcsw::fram::Address address) -> void;
Expand All @@ -41,12 +43,12 @@ TEST_CASE("Mocked functions do nothing by default")
SECTION("WriteTo() and ReadFrom()")
{
auto readData = std::array{0x11_b, 0x22_b, 0x33_b, 0x44_b};
fram::ReadFrom(address, Span(&readData), 0);
fram::ReadFrom(address, Span(&readData), 0 * s);
CHECK(readData == std::array{0x11_b, 0x22_b, 0x33_b, 0x44_b});

auto writeData = std::array{0xAA_b, 0xBB_b, 0xCC_b, 0xDD_b};
fram::WriteTo(address, Span(writeData), 0);
readData = fram::ReadFrom<writeData.size()>(address, 0);
fram::WriteTo(address, Span(writeData), 0 * s);
readData = fram::ReadFrom<writeData.size()>(address, * s);
CHECK(readData == decltype(readData){});
}
}
Expand Down

0 comments on commit 5fcbb4d

Please sign in to comment.