GCC Code Coverage Report


Directory: Fw/FilePacket/
File: CancelPacket.cpp
Date: 2026-09-03 21:14:53
Exec Total Coverage
Lines: 13 14 92.9%
Functions: 4 4 100.0%
Branches: 5 6 83.3%

Line Branch Exec Source
1 // ======================================================================
2 // \title CancelPacket.cpp
3 // \author bocchino
4 // \brief cpp file for FilePacket::CancelPacket
5 //
6 // \copyright
7 // Copyright 2009-2016, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12
13 #include <Fw/FilePacket/FilePacket.hpp>
14 #include <Fw/Types/Assert.hpp>
15
16 namespace Fw {
17
18 1 void FilePacket::CancelPacket ::initialize(const U32 sequenceIndex) {
19 1 this->m_header.initialize(FilePacket::T_CANCEL, sequenceIndex);
20 1 }
21
22 1 U32 FilePacket::CancelPacket ::bufferSize() const {
23 1 return this->m_header.bufferSize();
24 }
25
26 1 SerializeStatus FilePacket::CancelPacket ::toBuffer(Buffer& buffer) const {
27
3/3
✓ Branch 5 taken 1 times.
✓ Branch 11 taken 1 times.
✓ Branch 14 taken 1 times.
1 SerialBuffer serialBuffer(buffer.getData(), buffer.getSize());
28
1/1
✓ Branch 4 taken 1 times.
2 return this->m_header.toSerialBuffer(serialBuffer);
29 1 }
30
31 1 SerializeStatus FilePacket::CancelPacket ::fromSerialBuffer(SerialBuffer& serialBuffer) {
32 1 FW_ASSERT(this->m_header.m_type == T_CANCEL);
33
34
1/2
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
1 if (serialBuffer.getDeserializeSizeLeft() != 0) {
35 return FW_DESERIALIZE_SIZE_MISMATCH;
36 }
37
38 1 return FW_SERIALIZE_OK;
39 }
40
41 } // namespace Fw
42