GCC Code Coverage Report


Directory: ./
File: QueuedComponentBase.cpp
Date: 2026-09-23 22:12:10
Exec Total Coverage
Lines: 15 28 53.6%
Functions: 6 9 66.7%
Branches: 5 9 55.6%

Line Branch Exec Source
1 #include <Fw/Comp/QueuedComponentBase.hpp>
2 #include <Fw/FPrimeBasicTypes.hpp>
3 #include <Fw/Types/Assert.hpp>
4 #include <Os/QueueString.hpp>
5
6 #include <cstdio>
7
8 namespace Fw {
9
10
1/1
✓ Branch 2 taken 28 times.
28 QueuedComponentBase::QueuedComponentBase(const char* name) : PassiveComponentBase(name), m_msgsDropped(0) {}
11
12 56 QueuedComponentBase::~QueuedComponentBase() {}
13
14 28 void QueuedComponentBase::init(FwEnumStoreType instance) {
15 28 PassiveComponentBase::init(instance);
16 28 }
17
18 28 void QueuedComponentBase::deinit() {
19 28 this->m_queue.teardown();
20 28 }
21
22 #if FW_OBJECT_TO_STRING == 1
23 ✗ const char* QueuedComponentBase::getToStringFormatString() {
24 ✗ return "QueueComp: %s";
25 }
26 #endif
27
28 28 Os::Queue::Queue::Status QueuedComponentBase::createQueue(FwSizeType depth, FwSizeType msgSize) {
29
1/1
✓ Branch 1 taken 28 times.
28 Os::QueueString queueName;
30 #if FW_OBJECT_NAMES == 1
31
1/1
✓ Branch 1 taken 28 times.
28 queueName = this->m_objName;
32 #else
33 // Truncation of a queue name is benign
34 (void)queueName.format("CompQ_%" PRI_FwSizeType, Os::Queue::getNumQueues());
35 #endif
36
2/2
✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
56 return this->m_queue.create(this->getInstance(), queueName, depth, msgSize);
37 28 }
38
39 61 FwSizeType QueuedComponentBase::getNumMsgsDropped() {
40 61 return this->m_msgsDropped;
41 }
42
43 ✗ void QueuedComponentBase::incNumMsgDropped() {
44 ✗ this->m_msgsDropped++;
45 ✗ }
46
47 ✗ Fw::QueuedComponentBase::MsgDispatchStatus QueuedComponentBase::dispatchAvailableMessages() {
48 ✗ MsgDispatchStatus status = MSG_DISPATCH_OK;
49 ✗ const FwSizeType num_messages = this->m_queue.getMessagesAvailable();
50 ✗ for (FwSizeType i = 0; i < num_messages; i++) {
51 ✗ status = this->doDispatch();
52 ✗ if (status != MSG_DISPATCH_OK) {
53 ✗ break;
54 }
55 }
56 ✗ return status;
57 }
58 } // namespace Fw
59