GCC Code Coverage Report


Directory: ./
File: Os/DelegateConditionVariable.cpp
Date: 2026-10-14 21:15:02
Exec Total Coverage
Lines: 21 22 95.5%
Functions: 6 6 100.0%
Branches: 4 5 80.0%

Line Branch Exec Source
1 // ======================================================================
2 // \title Os/DelegateConditionVariable.cpp
3 // \brief implementation of Os::DelegateConditionVariable (link-time delegating Os::ConditionVariable)
4 // ======================================================================
5 #include "Os/DelegateConditionVariable.hpp"
6 #include "Fw/Types/Assert.hpp"
7
8 namespace Os {
9 3665 DelegateConditionVariable::DelegateConditionVariable()
10
1/1
✓ Branch 13 taken 3665 times.
3665 : m_delegate(*ConditionVariableInterface::getDelegate(m_handle_storage)) {}
11
12 7332 DelegateConditionVariable::~DelegateConditionVariable() {
13 7330 m_delegate.~ConditionVariableInterface();
14 7332 }
15
16 13 DelegateConditionVariable::Status DelegateConditionVariable::pend(Os::Mutex& mutex) {
17 13 FW_ASSERT(&this->m_delegate == reinterpret_cast<ConditionVariableInterface*>(&this->m_handle_storage[0]));
18
3/4
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 11 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
13 if (this->m_lock != nullptr && this->m_lock != &mutex) {
19 ✗ return Status::ERROR_DIFFERENT_MUTEX;
20 }
21 13 this->m_lock = &mutex;
22 13 return this->m_delegate.pend(mutex);
23 }
24 379342 void DelegateConditionVariable::notify() {
25 379342 FW_ASSERT(&this->m_delegate == reinterpret_cast<ConditionVariableInterface*>(&this->m_handle_storage[0]));
26 379342 this->m_delegate.notify();
27 379342 }
28 2 void DelegateConditionVariable::notifyAll() {
29 2 FW_ASSERT(&this->m_delegate == reinterpret_cast<ConditionVariableInterface*>(&this->m_handle_storage[0]));
30 2 this->m_delegate.notifyAll();
31 2 }
32
33 1 ConditionVariableHandle* DelegateConditionVariable::getHandle() {
34 1 FW_ASSERT(&this->m_delegate == reinterpret_cast<const ConditionVariableInterface*>(&this->m_handle_storage[0]));
35 1 return this->m_delegate.getHandle();
36 }
37
38 } // namespace Os
39