GCC Code Coverage Report


Directory: ./
File: PassiveComponentBase.cpp
Date: 2026-09-23 22:12:10
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 49 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 98 PassiveComponentBase::~PassiveComponentBase() {}
34
35 21 void PassiveComponentBase::deinit() {}
36
37 49 void PassiveComponentBase::init(FwEnumStoreType instance) {
38 49 ObjBase::init();
39 49 this->m_instance = instance;
40 49 }
41
42 8018 FwEnumStoreType PassiveComponentBase::getInstance() const {
43 8018 return this->m_instance;
44 }
45
46 49 void PassiveComponentBase ::setIdBase(const FwIdType idBase) {
47 49 this->m_idBase = idBase;
48 49 }
49
50 4025 FwIdType PassiveComponentBase ::getIdBase() const {
51 4025 return this->m_idBase;
52 }
53
54 } // namespace Fw
55