GCC Code Coverage Report


Directory: ./
File: Drv/Ports/DataTypes/DataBuffer.cpp
Date: 2026-09-03 22:12:29
Exec Total Coverage
Lines: 2 18 11.1%
Functions: 2 6 33.3%
Branches: 0 5 0.0%

Line Branch Exec Source
1 #include <Drv/Ports/DataTypes/DataBuffer.hpp>
2 #include <Fw/Types/Assert.hpp>
3
4 namespace Drv {
5
6 DataBuffer::DataBuffer(const U8* args, FwSizeType size) : Fw::LinearBufferBase(m_data, sizeof(m_data)) {
7 Fw::SerializeStatus stat = Fw::LinearBufferBase::setBuff(args, size);
8 FW_ASSERT(Fw::FW_SERIALIZE_OK == stat, static_cast<FwAssertArgType>(stat));
9 }
10
11 1 DataBuffer::DataBuffer() : Fw::LinearBufferBase(m_data, sizeof(m_data)) {}
12
13 2 DataBuffer::~DataBuffer() {}
14
15 // m_data contents are copied via setBuff below
16 // cppcheck-suppress missingMemberCopy
17 DataBuffer::DataBuffer(const DataBuffer& other) : Fw::LinearBufferBase(m_data, sizeof(m_data)) {
18 Fw::SerializeStatus stat = Fw::LinearBufferBase::setBuff(other.m_data, other.getSize());
19 FW_ASSERT(Fw::FW_SERIALIZE_OK == stat, static_cast<FwAssertArgType>(stat));
20 }
21
22 DataBuffer& DataBuffer::operator=(const DataBuffer& other) {
23 if (this == &other) {
24 return *this;
25 }
26
27 Fw::SerializeStatus stat = Fw::LinearBufferBase::setBuff(other.m_data, other.getSize());
28 FW_ASSERT(Fw::FW_SERIALIZE_OK == stat, static_cast<FwAssertArgType>(stat));
29 return *this;
30 }
31
32 FwSizeType DataBuffer::getBuffCapacity() const {
33 return this->getCapacity();
34 }
35
36 } // namespace Drv
37