Add POP_SERIALIZABLE to DeserializeDirectives#5378
Conversation
Coverage report — base
|
| Module | Line | Δ | Function | Δ | Branch | Δ |
|---|---|---|---|---|---|---|
Fw/DataStructures |
98.30 | +0.27 | 97.14 | +0.00 | 83.03 | +0.56 |
Modules without UTs
CFDP/Checksum/GTest, Drv/ByteStreamDriverModel, Drv/Interfaces, Drv/LinuxGpioDriver, Drv/LinuxI2cDriver, Drv/LinuxSpiDriver, Drv/LinuxUartDriver, Drv/Ports, Drv/Ports/DataTypes, FppTestProject/FppTest/interfaces, FppTestProject/FppTest/topology/async, FppTestProject/FppTest/topology/components/Comp, FppTestProject/FppTest/topology/components/Framework, FppTestProject/FppTest/topology/components/Receiver, FppTestProject/FppTest/topology/components/Sender, FppTestProject/FppTest/topology/guarded, FppTestProject/FppTest/topology/ports, FppTestProject/FppTest/topology/sync, FppTestProject/FppTest/topology/top_ports, FppTestProject/FppTest/topology/types, Fw/Cmd, Fw/Com, Fw/Comp, Fw/FilePacket/GTest, Fw/Fpy, Fw/Interfaces, Fw/Obj, Fw/Port, Fw/Ports/CompletionStatus, Fw/Ports/Ready, Fw/Ports/Signal, Fw/Ports/SuccessCondition, Fw/Prm, Fw/SerializableFile/test/TestSerializable, Fw/Sm, Fw/Test, Fw/Types/GTest, Os/Models, Svc/Cycle, Svc/DpPorts, Svc/Fatal, Svc/FatalHandler, Svc/FileDownlinkPorts, Svc/FprimeProtocol, Svc/Interfaces, Svc/PassiveConsoleTextLogger, Svc/Ping, Svc/PolyIf, Svc/Ports/CommsPorts, Svc/Ports/FilePorts, Svc/Ports/OsTimeEpoch, Svc/Ports/TlmPacketizerPorts, Svc/Ports/VersionPorts, Svc/Sched, Svc/Seq, Svc/Subtopologies/CdhCore, Svc/Subtopologies/ComCcsds, Svc/Subtopologies/ComFprime, Svc/Subtopologies/ComLoggerTee, Svc/Subtopologies/DataProducts, Svc/Subtopologies/DpCompression, Svc/Subtopologies/FileHandling, Svc/Types/TlmPacketizerTypes, Svc/WatchDog, TestDeploymentsProject/Ref/PingReceiver, TestDeploymentsProject/Ref/RecvBuffApp, TestDeploymentsProject/Ref/SendBuffApp, TestDeploymentsProject/Ref/Top, TestDeploymentsProject/Ref/TypeDemo, cmake/test/data/TestDeployment/TestBuildAutocoder, cmake/test/data/TestDeployment/TestChainedAutocoder, cmake/test/data/TestDeployment/TestHeaderAutocoder, cmake/test/data/TestDeployment/TestTargetAutocoder, cmake/test/data/test-fprime-library/TestLibrary/TestComponent, cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent
zimri-leisher
left a comment
There was a problem hiding this comment.
This was an unfortunate miss on the original PR and on my review. All other directives have this unit test, but ideally we should use CPP semantics to prevent this from being possible. I think if we removed the default case in the switch statement, it would be a compiler error if there were a directive ID that weren't handled. @Lex-ari can you try that? Make sure to still include the warning event and return Fw::SUCCESS::FAILURE, but just do it after the switch case.
Once you do that, please confirm (by removing a switch case) that the code fails to compile, to make sure this works.
Can confirm that removing the default case produces a compile error. Will make this change. |
|
Thanks. Looks good to me |
Change Description
Adds the missing
POP_SERIALIZABLEcase todeserializeDirectiveinSvc/FpySequencer/FpySequencerRunState.cpp, plus adeserialize_popSerializableunit test.Rationale
PR #5327 added the
POP_SERIALIZABLEdirective's handler anddispatchDirectivecase but not itsdeserializeDirectivecase, so the directive fails to decode at run time.Testing/Review Recommendations
Added unit tests to the FpySequencer to check deserialization of the popSerializable command.
Future Work
Implementing POP_SERIALIZABLE on the Fpy-backend side.
AI Usage (see policy)
Claude Code was used to identify the missing deserialize case and wrote implementation and unit tests.