Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FPP v2.1.0a7 #2676

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions FppTest/dp/DpTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,17 @@ void DpTest::schedIn_handler(const NATIVE_INT_TYPE portNum, U32 context) {
Fw::Success status = this->dpGet_Container1(CONTAINER_1_DATA_SIZE, container);
FW_ASSERT(status == Fw::Success::SUCCESS, status);
// Check the container
this->checkContainer(container, ContainerId::Container1, CONTAINER_1_PACKET_SIZE);
this->checkContainer(container, ContainerId::Container1, CONTAINER_1_PACKET_SIZE,
DpTest::ContainerPriority::Container1);
}
// Get a buffer for Container 2
{
DpContainer container;
Fw::Success status = this->dpGet_Container2(CONTAINER_2_DATA_SIZE, container);
FW_ASSERT(status == Fw::Success::SUCCESS);
// Check the container
this->checkContainer(container, ContainerId::Container2, CONTAINER_2_PACKET_SIZE);
this->checkContainer(container, ContainerId::Container2, CONTAINER_2_PACKET_SIZE,
DpTest::ContainerPriority::Container2);
}
// Get a buffer for Container 3
{
Expand All @@ -79,15 +81,17 @@ void DpTest::schedIn_handler(const NATIVE_INT_TYPE portNum, U32 context) {
Fw::Success status = this->dpGet_Container4(CONTAINER_4_DATA_SIZE, container);
FW_ASSERT(status == Fw::Success::SUCCESS);
// Check the container
this->checkContainer(container, ContainerId::Container4, CONTAINER_4_PACKET_SIZE);
this->checkContainer(container, ContainerId::Container4, CONTAINER_4_PACKET_SIZE,
DpTest::ContainerPriority::Container4);
}
// Get a buffer for Container 5
{
DpContainer container;
Fw::Success status = this->dpGet_Container5(CONTAINER_5_DATA_SIZE, container);
FW_ASSERT(status == Fw::Success::SUCCESS);
// Check the container
this->checkContainer(container, ContainerId::Container5, CONTAINER_5_PACKET_SIZE);
this->checkContainer(container, ContainerId::Container5, CONTAINER_5_PACKET_SIZE,
DpTest::ContainerPriority::Container5);
}
}

Expand Down Expand Up @@ -178,11 +182,15 @@ void DpTest ::dpRecv_Container5_handler(DpContainer& container, Fw::Success::T s
// Private helper functions
// ----------------------------------------------------------------------

void DpTest::checkContainer(const DpContainer& container, FwDpIdType localId, FwSizeType size) const {
void DpTest::checkContainer(const DpContainer& container,
FwDpIdType localId,
FwSizeType size,
FwDpPriorityType priority) const {
FW_ASSERT(container.getBaseId() == this->getIdBase(), container.getBaseId(), this->getIdBase());
FW_ASSERT(container.getId() == container.getBaseId() + localId, container.getId(), container.getBaseId(),
ContainerId::Container1);
FW_ASSERT(container.getBuffer().getSize() == size, container.getBuffer().getSize(), size);
FW_ASSERT(container.getPriority() == priority, container.getPriority(), priority);
}

} // end namespace FppTest
80 changes: 42 additions & 38 deletions FppTest/dp/DpTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,28 @@ class DpTest : public DpTestComponentBase {
//! Set the send time
void setSendTime(Fw::Time time) { this->sendTime = time; }

PRIVATE:
// ----------------------------------------------------------------------
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------

//! Handler implementation for schedIn
void schedIn_handler(const NATIVE_INT_TYPE portNum, //!< The port number
U32 context //!< The call order
) override;

PRIVATE:
// ----------------------------------------------------------------------
// Data product handler implementations
// ----------------------------------------------------------------------

//! Receive a data product container of type Container1
//! \return Serialize status
void dpRecv_Container1_handler(DpContainer& container, //!< The container
Fw::Success::T //!< The container status
) override;
PRIVATE :
// ----------------------------------------------------------------------
// Handler implementations for user-defined typed input ports
// ----------------------------------------------------------------------

//! Handler implementation for schedIn
void
schedIn_handler(const NATIVE_INT_TYPE portNum, //!< The port number
U32 context //!< The call order
) override;

PRIVATE :
// ----------------------------------------------------------------------
// Data product handler implementations
// ----------------------------------------------------------------------

//! Receive a data product container of type Container1
//! \return Serialize status
void
dpRecv_Container1_handler(DpContainer& container, //!< The container
Fw::Success::T //!< The container status
) override;

//! Receive a data product container of type Container2
//! \return Serialize status
Expand All @@ -114,24 +116,26 @@ class DpTest : public DpTestComponentBase {
Fw::Success::T //!< The container status
) override;

PRIVATE:
// ----------------------------------------------------------------------
// Private helper functions
// ----------------------------------------------------------------------

//! Check a container for validity
void checkContainer(const DpContainer& container, //!< The container
FwDpIdType localId, //!< The expected local id
FwSizeType size //!< The expected size
) const;

PRIVATE:
// ----------------------------------------------------------------------
// Private member variables
// ----------------------------------------------------------------------

//! U32Record data
const U32 u32RecordData;
PRIVATE :
// ----------------------------------------------------------------------
// Private helper functions
// ----------------------------------------------------------------------

//! Check a container for validity
void
checkContainer(const DpContainer& container, //!< The container
FwDpIdType localId, //!< The expected local id
FwSizeType size, //!< The expected size
FwDpPriorityType priority //!< The expected priority
) const;

PRIVATE :
// ----------------------------------------------------------------------
// Private member variables
// ----------------------------------------------------------------------

//! U32Record data
const U32 u32RecordData;

//! DataRecord data
const U16 dataRecordData;
Expand Down
11 changes: 0 additions & 11 deletions Svc/DpWriter/test/ut/DpWriterTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ DpWriterTester ::~DpWriterTester() {}
// Handlers for typed from ports
// ----------------------------------------------------------------------

void DpWriterTester ::from_deallocBufferSendOut_handler(NATIVE_INT_TYPE portNum, Fw::Buffer& buffer) {
this->pushFromPortEntry_deallocBufferSendOut(buffer);
}

void DpWriterTester ::from_dpWrittenOut_handler(NATIVE_INT_TYPE portNum,
const fileNameString& fileName,
FwDpPriorityType priority,
FwSizeType size) {
this->pushFromPortEntry_dpWrittenOut(fileName, priority, size);
}

void DpWriterTester::from_procBufferSendOut_handler(NATIVE_INT_TYPE portNum, Fw::Buffer& buffer) {
this->pushFromPortEntry_procBufferSendOut(buffer);
this->abstractState.m_procTypes |= (1 << portNum);
Expand Down
14 changes: 1 addition & 13 deletions Svc/DpWriter/test/ut/DpWriterTester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,10 @@ class DpWriterTester : public DpWriterGTestBase {
// Handlers for typed from ports
// ----------------------------------------------------------------------

//! Handler implementation for deallocBufferSendOut
void from_deallocBufferSendOut_handler(NATIVE_INT_TYPE portNum, //!< The port number
Fw::Buffer& fwBuffer //!< The buffer
);

//! Handler implementation for dpWrittenOut
void from_dpWrittenOut_handler(NATIVE_INT_TYPE portNum, //!< The port number
const Svc::DpWrittenPortStrings::StringSize256& fileName, //!< The file name
FwDpPriorityType priority, //!< The priority
FwSizeType size //!< The file size
);

//! Handler implementation for procBufferSendOut
void from_procBufferSendOut_handler(NATIVE_INT_TYPE portNum, //!< The port number
Fw::Buffer& fwBuffer //!< The buffer
);
) final;

public:
// ----------------------------------------------------------------------
Expand Down
22 changes: 11 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ fprime-fpl-convert-xml==1.0.3
fprime-fpl-extract-xml==1.0.3
fprime-fpl-layout==1.0.3
fprime-fpl-write-pic==1.0.3
fprime-fpp-check==2.1.0a6
fprime-fpp-depend==2.1.0a6
fprime-fpp-filenames==2.1.0a6
fprime-fpp-format==2.1.0a6
fprime-fpp-from-xml==2.1.0a6
fprime-fpp-locate-defs==2.1.0a6
fprime-fpp-locate-uses==2.1.0a6
fprime-fpp-syntax==2.1.0a6
fprime-fpp-to-cpp==2.1.0a6
fprime-fpp-to-json==2.1.0a6
fprime-fpp-to-xml==2.1.0a6
fprime-fpp-check==2.1.0a7
fprime-fpp-depend==2.1.0a7
fprime-fpp-filenames==2.1.0a7
fprime-fpp-format==2.1.0a7
fprime-fpp-from-xml==2.1.0a7
fprime-fpp-locate-defs==2.1.0a7
fprime-fpp-locate-uses==2.1.0a7
fprime-fpp-syntax==2.1.0a7
fprime-fpp-to-cpp==2.1.0a7
fprime-fpp-to-json==2.1.0a7
fprime-fpp-to-xml==2.1.0a7
bocchino marked this conversation as resolved.
Show resolved Hide resolved
fprime-gds==3.4.3
fprime-tools==3.4.4
fprime-visual==1.0.2
Expand Down
Loading