Skip to content

Commit

Permalink
Update devcontainer version to 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromehue committed May 3, 2024
1 parent fc0fd3d commit 7c28670
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "STS1 COBC Full",
"image": "tuwienspaceteam/sts1-cobc:1.6.0"
"image": "tuwienspaceteam/sts1-cobc:1.6.1"
}
10 changes: 5 additions & 5 deletions Sts1CobcSw/Periphery/FramMock.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include <Sts1CobcSw/Periphery/FramMock.hpp>

#include <array>
#include <cstring>
#include <fstream>
#include <ios>
#include <fstream> // IWYU pragma: keep
#include <iostream>
#include <vector>


namespace sts1cobcsw::fram
{

auto ramSimulation = std::array<uint8_t, 1048576>{};
constexpr auto framSize = (1U << 20U);
auto ramSimulation = std::array<uint8_t, framSize>{};
MockMode mockDevice = MockMode::ram;
constexpr auto mockFilename = "FramMock.bin";

Expand Down Expand Up @@ -91,7 +91,7 @@ auto WriteTo(Address address, void const * data, std::size_t nBytes) -> void
}
else
{
// FIXME: Fix pointer arithmetic
// FIXME: Fix pointer arithmetic and out of bounds access
std::memcpy(ramSimulation.data() + address, data, nBytes);
}
}
Expand Down
2 changes: 2 additions & 0 deletions Sts1CobcSw/Periphery/FramMock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <Sts1CobcSw/Periphery/Fram.hpp>

#include <cstdint>


namespace sts1cobcsw::fram
{
Expand Down
7 changes: 0 additions & 7 deletions Tests/UnitTests/Fram.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ TEST_CASE("Fram mock using ram")
std::generate(
testData.begin(), testData.end(), [&]() { return static_cast<std::byte>(randomEngine()); });
WriteAndReadTestData(address);
<<<<<<< HEAD
=======

auto deviceId = fram::ReadDeviceId();
constexpr auto correctDeviceId =
Expand All @@ -53,7 +51,6 @@ TEST_CASE("Fram mock using ram")
fram::SetDoReadDeviceId(ReadCorrectDeviceId);
deviceId = fram::ReadDeviceId();
REQUIRE(deviceId == correctDeviceId);
>>>>>>> 465f578 (Fix more stuff)
}

TEST_CASE("Fram mock using file")
Expand All @@ -78,14 +75,10 @@ auto WriteAndReadTestData(fram::Address const & address) -> void
static_cast<int>(testDataSize),
static_cast<unsigned int>(address));
fram::WriteTo(address, Span(testData));
<<<<<<< HEAD
std::printf("Reading n bytes from address ...\n");
=======

std::printf("Reading %d bytes from address 0x%08x ...\n",
static_cast<int>(testDataSize),
static_cast<unsigned int>(address));
>>>>>>> 465f578 (Fix more stuff)
fram::ReadFrom(address, Span(&readData));

std::printf("Comparing first %d written and read bytes:\n", nBytesToPrint);
Expand Down

0 comments on commit 7c28670

Please sign in to comment.