GCC Code Coverage Report


Directory: ./
File: Fw/FilePacket/CancelPacket.cpp
Date: 2026-09-03 21:13:48
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 4 void FilePacket::CancelPacket ::initialize(const U32 sequenceIndex) {
19 4 this->m_header.initialize(FilePacket::T_CANCEL, sequenceIndex);
20 4 }
21
22 5 U32 FilePacket::CancelPacket ::bufferSize() const {
23 5 return this->m_header.bufferSize();
24 }
25
26 4 SerializeStatus FilePacket::CancelPacket ::toBuffer(Buffer& buffer) const {
27
3/3
✓ Branch 5 taken 4 times.
✓ Branch 11 taken 4 times.
✓ Branch 14 taken 4 times.
4 SerialBuffer serialBuffer(buffer.getData(), buffer.getSize());
28
1/1
✓ Branch 4 taken 4 times.
8 return this->m_header.toSerialBuffer(serialBuffer);
29 4 }
30
31 3 SerializeStatus FilePacket::CancelPacket ::fromSerialBuffer(SerialBuffer& serialBuffer) {
32 3 FW_ASSERT(this->m_header.m_type == T_CANCEL);
33
34
1/2
✗ Branch 5 not taken.
✓ Branch 6 taken 3 times.
3 if (serialBuffer.getDeserializeSizeLeft() != 0) {
35 return FW_DESERIALIZE_SIZE_MISMATCH;
36 }
37
38 3 return FW_SERIALIZE_OK;
39 }
40
41 } // namespace Fw
42