GCC Code Coverage Report


Directory: ./
File: Os/CountingSemaphore.cpp
Date: 2026-10-14 21:15:02
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 2573 CountingSemaphore::CountingSemaphore(U32 initial_count)
6
1/1
✓ Branch 9 taken 2573 times.
2573 : m_delegate(*CountingSemaphoreInterface::getDelegate(m_handle_storage, initial_count)) {}
7
8 5146 CountingSemaphore::~CountingSemaphore() {
9 5146 m_delegate.~CountingSemaphoreInterface();
10 5146 }
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 200907 CountingSemaphore::Status CountingSemaphore::tryWait() {
23 200907 FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
24 201692 return this->m_delegate.tryWait();
25 }
26
27 199434 CountingSemaphore::Status CountingSemaphore::post() {
28 199434 FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
29 201457 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