GCC Code Coverage Report


Directory: ./
File: Fw/Comp/PassiveComponentBase.cpp
Date: 2026-09-03 22:12:29
Exec Total Coverage
Lines: 14 24 58.3%
Functions: 7 9 77.8%
Branches: 0 5 0.0%

Line Branch Exec Source
1 #include <Fw/Comp/PassiveComponentBase.hpp>
2 #include <Fw/FPrimeBasicTypes.hpp>
3 #include <Fw/Types/Assert.hpp>
4
5 #include <Fw/Types/ExternalString.hpp>
6
7 namespace Fw {
8
9 48 PassiveComponentBase::PassiveComponentBase(const char* name) : Fw::ObjBase(name), m_idBase(0), m_instance(0) {}
10
11 #if FW_OBJECT_TO_STRING == 1
12 const char* PassiveComponentBase::getToStringFormatString() {
13 return "Comp: %s";
14 }
15
16 void PassiveComponentBase::toString(char* buffer, FwSizeType size) {
17 FW_ASSERT(size > 0);
18 FW_ASSERT(buffer != nullptr);
19 Fw::FormatStatus status = Fw::ExternalString(buffer, static_cast<Fw::ExternalString::SizeType>(size))
20 .format(this->getToStringFormatString(),
21 #if FW_OBJECT_NAMES == 1
22 this->m_objName.toChar()
23 #else
24 "UNKNOWN"
25 #endif
26 );
27 if (status != Fw::FormatStatus::SUCCESS) {
28 buffer[0] = 0;
29 }
30 }
31 #endif
32
33 96 PassiveComponentBase::~PassiveComponentBase() {}
34
35 21 void PassiveComponentBase::deinit() {}
36
37 48 void PassiveComponentBase::init(FwEnumStoreType instance) {
38 48 ObjBase::init();
39 48 this->m_instance = instance;
40 48 }
41
42 7682 FwEnumStoreType PassiveComponentBase::getInstance() const {
43 7682 return this->m_instance;
44 }
45
46 48 void PassiveComponentBase ::setIdBase(const FwIdType idBase) {
47 48 this->m_idBase = idBase;
48 48 }
49
50 3877 FwIdType PassiveComponentBase ::getIdBase() const {
51 3877 return this->m_idBase;
52 }
53
54 } // namespace Fw
55