Skip to content

Commit

Permalink
Fix CI issue
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-bc committed Feb 3, 2025
1 parent 9007b8e commit 78e1aad
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ======================================================================
// \title FrameAccumulatorTestMain.cpp
// \title FprimeFrameDetectorTestMain.cpp
// \author thomas-bc
// \brief cpp file for FrameAccumulator component test main function
// ======================================================================
Expand All @@ -11,11 +11,11 @@

U32 CIRCULAR_BUFFER_TEST_SIZE = 2048;

//! \brief Create an F' frame and serialize it into the supplied circular buffer
//! \brief Create an F´ frame and serialize it into the supplied circular buffer
//! \param circular_buffer The circular buffer to serialize the frame into
//! \note The frame is generated with random data of random size
//! \return The size of the generated frame
FwSizeType create_random_fprime_frame(Types::CircularBuffer& circular_buffer) {
FwSizeType generate_random_fprime_frame(Types::CircularBuffer& circular_buffer) {
constexpr FwSizeType FRAME_HEADER_SIZE = 8;
constexpr FwSizeType FRAME_FOOTER_SIZE = 4;

Expand Down Expand Up @@ -76,7 +76,7 @@ TEST(FprimeFrameDetector, TestFrameDetected) {
::memset(buffer, 0, CIRCULAR_BUFFER_TEST_SIZE);
Types::CircularBuffer circular_buffer(buffer, CIRCULAR_BUFFER_TEST_SIZE);

FwSizeType frame_size = create_random_fprime_frame(circular_buffer);
FwSizeType frame_size = generate_random_fprime_frame(circular_buffer);

Svc::FrameDetector::Status status;
FwSizeType size_out = 0;
Expand All @@ -93,12 +93,12 @@ TEST(FprimeFrameDetector, TestNoFrameDetected) {
::memset(buffer, 0, CIRCULAR_BUFFER_TEST_SIZE);
Types::CircularBuffer circular_buffer(buffer, CIRCULAR_BUFFER_TEST_SIZE);

(void) create_random_fprime_frame(circular_buffer);
(void) generate_random_fprime_frame(circular_buffer);
// Remove 1 byte from the beginning of the frame, making it invalid
circular_buffer.rotate(1);

Svc::FrameDetector::Status status;
FwSizeType unused;
FwSizeType unused = 0;
status = fprime_detector.detect(circular_buffer, unused);

EXPECT_EQ(status, Svc::FrameDetector::Status::NO_FRAME_DETECTED);
Expand All @@ -110,11 +110,11 @@ TEST(FprimeFrameDetector, TestMoreDataNeeded) {
::memset(buffer, 0, CIRCULAR_BUFFER_TEST_SIZE);
Types::CircularBuffer circular_buffer(buffer, CIRCULAR_BUFFER_TEST_SIZE);

(void) create_random_fprime_frame(circular_buffer);
(void) generate_random_fprime_frame(circular_buffer);
circular_buffer.m_allocated_size--; // Remove 1 byte from the end of the frame to trigger "more data needed"

Svc::FrameDetector::Status status;
FwSizeType unused;
FwSizeType unused = 0;
status = fprime_detector.detect(circular_buffer, unused);

EXPECT_EQ(status, Svc::FrameDetector::Status::MORE_DATA_NEEDED);
Expand Down

0 comments on commit 78e1aad

Please sign in to comment.