GCC Code Coverage Report


Directory: ./
File: lib/ecs/src/ComponentManager.cpp
Date: 2025-09-29 13:19:55
Exec Total Coverage
Lines: 9 14 64.3%
Functions: 1 2 50.0%
Branches: 8 18 44.4%

Line Branch Exec Source
1 #include "ECS/ComponentManager.hpp"
2 #include <algorithm>
3
4 namespace ECS {
5 1 void ComponentManager::RemoveAllComponents(EntityID entity) {
6
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 auto it = m_entityComponents.find(entity);
7
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 if (it != m_entityComponents.end()) {
8
2/2
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 1 times.
2 for (ComponentTypeID typeID : it->second) {
9
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 auto arrayIt = m_componentArrays.find(typeID);
10
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 if (arrayIt != m_componentArrays.end()) {
11
1/2
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 arrayIt->second->RemoveComponent(entity);
12 }
13 }
14
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 m_entityComponents.erase(it);
15 }
16 1 }
17
18 void ComponentManager::Clear() {
19 for (auto& pair : m_componentArrays) {
20 pair.second->Clear();
21 }
22 m_entityComponents.clear();
23 }
24 }
25