GCC Code Coverage Report


Directory: ./
File: Os/Condition.cpp
Date: 2026-09-03 22:12:29
Exec Total Coverage
Lines: 17 25 68.0%
Functions: 5 7 71.4%
Branches: 4 5 80.0%

Line Branch Exec Source
1 #include "Os/Condition.hpp"
2 #include "Fw/Types/Assert.hpp"
3
4 namespace Os {
5
1/1
✓ Branch 2 taken 56 times.
56 ConditionVariable::ConditionVariable() : m_delegate(*ConditionVariableInterface::getDelegate(m_handle_storage)) {}
6
7 112 ConditionVariable::~ConditionVariable() {
8 112 m_delegate.~ConditionVariableInterface();
9 112 }
10
11 4769 ConditionVariable::Status ConditionVariable::pend(Os::Mutex& mutex) {
12 4769 FW_ASSERT(&this->m_delegate == reinterpret_cast<ConditionVariableInterface*>(&this->m_handle_storage[0]));
13
3/4
✓ Branch 0 taken 4749 times.
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 4749 times.
4769 if (this->m_lock != nullptr && this->m_lock != &mutex) {
14 return Status::ERROR_DIFFERENT_MUTEX;
15 };
16 4769 this->m_lock = &mutex;
17 4769 return this->m_delegate.pend(mutex);
18 }
19 4770 void ConditionVariable::wait(Os::Mutex& mutex) {
20 4770 Status status = this->pend(mutex);
21 4763 FW_ASSERT(status == Status::OP_OK, static_cast<FwAssertArgType>(status));
22 4763 }
23 13867 void ConditionVariable::notify() {
24 13867 FW_ASSERT(&this->m_delegate == reinterpret_cast<ConditionVariableInterface*>(&this->m_handle_storage[0]));
25 13867 this->m_delegate.notify();
26 13838 }
27 void ConditionVariable::notifyAll() {
28 FW_ASSERT(&this->m_delegate == reinterpret_cast<ConditionVariableInterface*>(&this->m_handle_storage[0]));
29 this->m_delegate.notifyAll();
30 }
31
32 ConditionVariableHandle* ConditionVariable::getHandle() {
33 FW_ASSERT(&this->m_delegate == reinterpret_cast<const ConditionVariableInterface*>(&this->m_handle_storage[0]));
34 return this->m_delegate.getHandle();
35 }
36
37 } // namespace Os
38