GCC Code Coverage Report


Directory: ./
File: Os/Condition.cpp
Date: 2026-09-23 21:11:01
Exec Total Coverage
Lines: 24 25 96.0%
Functions: 7 7 100.0%
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 14 taken 3485 times.
3485 ConditionVariable::ConditionVariable() : m_delegate(*ConditionVariableInterface::getDelegate(m_handle_storage)) {}
6
7 6972 ConditionVariable::~ConditionVariable() {
8 6970 m_delegate.~ConditionVariableInterface();
9 6972 }
10
11 16 ConditionVariable::Status ConditionVariable::pend(Os::Mutex& mutex) {
12 16 FW_ASSERT(&this->m_delegate == reinterpret_cast<ConditionVariableInterface*>(&this->m_handle_storage[0]));
13
3/4
✓ Branch 4 taken 3 times.
✓ Branch 5 taken 13 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 3 times.
16 if (this->m_lock != nullptr && this->m_lock != &mutex) {
14 ✗ return Status::ERROR_DIFFERENT_MUTEX;
15 };
16 16 this->m_lock = &mutex;
17 16 return this->m_delegate.pend(mutex);
18 }
19 14 void ConditionVariable::wait(Os::Mutex& mutex) {
20 14 Status status = this->pend(mutex);
21 14 FW_ASSERT(status == Status::OP_OK, static_cast<FwAssertArgType>(status));
22 14 }
23 315283 void ConditionVariable::notify() {
24 315283 FW_ASSERT(&this->m_delegate == reinterpret_cast<ConditionVariableInterface*>(&this->m_handle_storage[0]));
25 315283 this->m_delegate.notify();
26 315283 }
27 2 void ConditionVariable::notifyAll() {
28 2 FW_ASSERT(&this->m_delegate == reinterpret_cast<ConditionVariableInterface*>(&this->m_handle_storage[0]));
29 2 this->m_delegate.notifyAll();
30 2 }
31
32 1 ConditionVariableHandle* ConditionVariable::getHandle() {
33 1 FW_ASSERT(&this->m_delegate == reinterpret_cast<const ConditionVariableInterface*>(&this->m_handle_storage[0]));
34 1 return this->m_delegate.getHandle();
35 }
36
37 } // namespace Os
38