GCC Code Coverage Report


Directory: ./
File: Fw/Port/InputSerializePort.cpp
Date: 2026-09-23 21:11:01
Exec Total Coverage
Lines: 16 18 88.9%
Functions: 5 6 83.3%
Branches: 0 0 -%

Line Branch Exec Source
1 #include <Fw/Port/InputSerializePort.hpp>
2 #include <Fw/Types/Assert.hpp>
3 #include <cstdio>
4
5 #if FW_PORT_SERIALIZATION == 1
6
7 namespace Fw {
8
9 // SerializePort has no call interface. It is to pass through serialized data
10 3975 InputSerializePort::InputSerializePort() : InputPortBase(), m_func(nullptr) {}
11 7950 InputSerializePort::~InputSerializePort() {}
12
13 3975 void InputSerializePort::init() {
14 3975 InputPortBase::init();
15 3975 }
16
17 10095 SerializeStatus InputSerializePort::invokeSerial(LinearBufferBase& buffer) {
18 10095 FW_ASSERT(this->m_comp != nullptr);
19 10095 FW_ASSERT(this->m_func != nullptr);
20
21 10095 this->m_func(this->m_comp, this->m_portNum, buffer);
22
23 // The normal input ports perform deserialize() on the passed buffer,
24 // which is what this status is based on. This is not the case for the
25 // InputSerializePort, so just return an okay status
26 10095 return FW_SERIALIZE_OK;
27 }
28
29 3975 void InputSerializePort::addCallComp(Fw::PassiveComponentBase* callComp, CompFuncPtr funcPtr) {
30 3975 FW_ASSERT(callComp != nullptr);
31 3975 FW_ASSERT(funcPtr != nullptr);
32 3975 this->m_comp = callComp;
33 3975 this->m_func = funcPtr;
34 3975 }
35
36 #if FW_OBJECT_TO_STRING == 1
37 ✗ const char* InputSerializePort::getToStringFormatString() {
38 ✗ return "Input Serial Port: %s %s->(%s)";
39 }
40 #endif
41
42 } // namespace Fw
43 #endif
44