GCC Code Coverage Report


Directory: ./
File: Os/CountingSemaphore.cpp
Date: 2026-09-23 21:11:01
Exec Total Coverage
Lines: 17 20 85.0%
Functions: 6 7 85.7%
Branches: 1 1 100.0%

Line Branch Exec Source
1 #include "Os/CountingSemaphore.hpp"
2 #include "Fw/Types/Assert.hpp"
3
4 namespace Os {
5 2585 CountingSemaphore::CountingSemaphore(U32 initial_count)
6
1/1
✓ Branch 9 taken 2585 times.
2585 : m_delegate(*CountingSemaphoreInterface::getDelegate(m_handle_storage, initial_count)) {}
7
8 5170 CountingSemaphore::~CountingSemaphore() {
9 5170 m_delegate.~CountingSemaphoreInterface();
10 5170 }
11
12 1044 CountingSemaphore::Status CountingSemaphore::wait() {
13 1044 FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
14 1044 return this->m_delegate.wait();
15 }
16
17 8 CountingSemaphore::Status CountingSemaphore::waitTimeout(const Fw::TimeInterval& interval) {
18 8 FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
19 8 return this->m_delegate.waitTimeout(interval);
20 }
21
22 234716 CountingSemaphore::Status CountingSemaphore::tryWait() {
23 234716 FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
24 235417 return this->m_delegate.tryWait();
25 }
26
27 235737 CountingSemaphore::Status CountingSemaphore::post() {
28 235737 FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
29 236577 return this->m_delegate.post();
30 }
31
32 ✗ CountingSemaphoreHandle* CountingSemaphore::getHandle() {
33 ✗ FW_ASSERT(&this->m_delegate == reinterpret_cast<const CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
34 ✗ return this->m_delegate.getHandle();
35 }
36
37 } // namespace Os
38