GCC Code Coverage Report


Directory: ./
File: Os/Condition.cpp
Date: 2026-09-23 22:11:34
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 58 times.
58 ConditionVariable::ConditionVariable() : m_delegate(*ConditionVariableInterface::getDelegate(m_handle_storage)) {}
6
7 116 ConditionVariable::~ConditionVariable() {
8 116 m_delegate.~ConditionVariableInterface();
9 116 }
10
11 5105 ConditionVariable::Status ConditionVariable::pend(Os::Mutex& mutex) {
12 5105 FW_ASSERT(&this->m_delegate == reinterpret_cast<ConditionVariableInterface*>(&this->m_handle_storage[0]));
13
3/4
✓ Branch 0 taken 5085 times.
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 5085 times.
5105 if (this->m_lock != nullptr && this->m_lock != &mutex) {
14 ✗ return Status::ERROR_DIFFERENT_MUTEX;
15 };
16 5105 this->m_lock = &mutex;
17 5105 return this->m_delegate.pend(mutex);
18 }
19 5105 void ConditionVariable::wait(Os::Mutex& mutex) {
20 5105 Status status = this->pend(mutex);
21 5072 FW_ASSERT(status == Status::OP_OK, static_cast<FwAssertArgType>(status));
22 5072 }
23 15127 void ConditionVariable::notify() {
24 15127 FW_ASSERT(&this->m_delegate == reinterpret_cast<ConditionVariableInterface*>(&this->m_handle_storage[0]));
25 15127 this->m_delegate.notify();
26 15135 }
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