From b1c21a0cde162f1132519229809ed17cdc3f4381 Mon Sep 17 00:00:00 2001 From: "Robert L. Bocchino Jr." Date: Fri, 12 Apr 2024 09:06:29 -0700 Subject: [PATCH 1/2] Update FPP; revise unit tests --- FppTest/dp/DpTest.cpp | 18 ++++-- FppTest/dp/DpTest.hpp | 80 +++++++++++++------------ Svc/DpWriter/test/ut/DpWriterTester.cpp | 11 ---- Svc/DpWriter/test/ut/DpWriterTester.hpp | 14 +---- requirements.txt | 22 +++---- 5 files changed, 67 insertions(+), 78 deletions(-) diff --git a/FppTest/dp/DpTest.cpp b/FppTest/dp/DpTest.cpp index 25459c1798..da812182d3 100644 --- a/FppTest/dp/DpTest.cpp +++ b/FppTest/dp/DpTest.cpp @@ -56,7 +56,8 @@ 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 { @@ -64,7 +65,8 @@ void DpTest::schedIn_handler(const NATIVE_INT_TYPE portNum, U32 context) { 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 { @@ -79,7 +81,8 @@ 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 { @@ -87,7 +90,8 @@ void DpTest::schedIn_handler(const NATIVE_INT_TYPE portNum, U32 context) { 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); } } @@ -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 diff --git a/FppTest/dp/DpTest.hpp b/FppTest/dp/DpTest.hpp index 88876d876d..47959a0a7f 100644 --- a/FppTest/dp/DpTest.hpp +++ b/FppTest/dp/DpTest.hpp @@ -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 @@ -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; diff --git a/Svc/DpWriter/test/ut/DpWriterTester.cpp b/Svc/DpWriter/test/ut/DpWriterTester.cpp index b6ad62aabf..b8c4467f90 100644 --- a/Svc/DpWriter/test/ut/DpWriterTester.cpp +++ b/Svc/DpWriter/test/ut/DpWriterTester.cpp @@ -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); diff --git a/Svc/DpWriter/test/ut/DpWriterTester.hpp b/Svc/DpWriter/test/ut/DpWriterTester.hpp index e41dcc0210..48b8e0a078 100644 --- a/Svc/DpWriter/test/ut/DpWriterTester.hpp +++ b/Svc/DpWriter/test/ut/DpWriterTester.hpp @@ -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: // ---------------------------------------------------------------------- diff --git a/requirements.txt b/requirements.txt index 0a281fb343..63e5e08545 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 fprime-gds==3.4.3 fprime-tools==3.4.4 fprime-visual==1.0.2 From 33d6519084d40ab7535ee8e698286158b7386069 Mon Sep 17 00:00:00 2001 From: "Robert L. Bocchino Jr." Date: Mon, 15 Apr 2024 10:28:33 -0700 Subject: [PATCH 2/2] Add fpp-to-dict to requirements --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 63e5e08545..61ae357cd4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -27,6 +27,7 @@ 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-dict==2.1.0a7 fprime-fpp-to-json==2.1.0a7 fprime-fpp-to-xml==2.1.0a7 fprime-gds==3.4.3