Chrysalis - Pattern Test Coverage


pattern/
File: pattern/include/ScopedNamedElementsContainer.h
Date: 2026-08-27 18:35:18
Lines:
10/11
90.9%
Functions:
13/16
81.2%
Branches:
5/10
50.0%
Decisions:
4/8
50.0%
Calls:
71/120
59.2%

Line Branch Decision Call Exec Source
1 #ifndef CHRYSALIS_SCOPED_H
2 #define CHRYSALIS_SCOPED_H
3
4 #include "NamedElementsContainer.h"
5
6 namespace Chrysalis {
7 template<typename T>
8 class ScopedNamedElementsContainer: public NamedElementsContainer<T> {
9 PROVIDE_SERIALIZATION_ACCESS_T(ScopedNamedElementsContainer)
10 public:
11
10/10
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
✓ Call 6 invoked.
✓ Call 7 invoked.
✓ Call 8 invoked.
✓ Call 9 invoked.
52 explicit ScopedNamedElementsContainer(): parent_(nullptr) {}
12
10/10
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
✓ Call 6 invoked.
✓ Call 7 invoked.
✓ Call 8 invoked.
✓ Call 9 invoked.
308 explicit ScopedNamedElementsContainer(const ScopedNamedElementsContainer* parent): parent_(parent) {}
13
14 68 [[nodiscard]] bool has(const std::string& name) const override {
15
2/2
✓ Branch 7 taken 28 times.
✓ Branch 8 taken 6 times.
2/2
✓ Decision 'true' taken 28 times.
✓ Decision 'false' taken 6 times.
7/7
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
✓ Call 6 invoked.
68 if (NamedElementsContainer<T>::has(name)) return true;
16
2/2
✓ Branch 4 taken 3 times.
✓ Branch 5 taken 3 times.
2/2
✓ Decision 'true' taken 3 times.
✓ Decision 'false' taken 3 times.
35/35
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 6 invoked.
✓ Call 7 invoked.
✓ Call 8 invoked.
✓ Call 9 invoked.
✓ Call 10 invoked.
✓ Call 11 invoked.
✓ Call 12 invoked.
✓ Call 13 invoked.
✓ Call 14 invoked.
✓ Call 15 invoked.
✓ Call 16 invoked.
✓ Call 17 invoked.
✓ Call 18 invoked.
✓ Call 19 invoked.
✓ Call 20 invoked.
✓ Call 21 invoked.
✓ Call 22 invoked.
✓ Call 23 invoked.
✓ Call 24 invoked.
✓ Call 25 invoked.
✓ Call 26 invoked.
✓ Call 27 invoked.
✓ Call 28 invoked.
✓ Call 29 invoked.
✓ Call 30 invoked.
✓ Call 31 invoked.
✓ Call 32 invoked.
✓ Call 33 invoked.
✓ Call 34 invoked.
✓ Call 35 invoked.
✓ Call 36 invoked.
12 if (parent_) return parent_->has(name);
17 6 return false;
18 }
19 19 T* get(const std::string& name) const override {
20
0/2
✗ Branch 7 not taken.
✗ Branch 8 not taken.
0/2
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
0/14
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ Call 6 not invoked.
✗ Call 9 not invoked.
✗ Call 10 not invoked.
✗ Call 11 not invoked.
✗ Call 12 not invoked.
✗ Call 13 not invoked.
✗ Call 14 not invoked.
✗ Call 15 not invoked.
19 if (NamedElementsContainer<T>::has(name)) return NamedElementsContainer<T>::get(name);
21
0/2
✗ Branch 4 not taken.
✗ Branch 5 not taken.
0/2
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
0/35
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ Call 8 not invoked.
✗ Call 9 not invoked.
✗ Call 10 not invoked.
✗ Call 11 not invoked.
✗ Call 12 not invoked.
✗ Call 13 not invoked.
✗ Call 14 not invoked.
✗ Call 15 not invoked.
✗ Call 16 not invoked.
✗ Call 17 not invoked.
✗ Call 18 not invoked.
✗ Call 19 not invoked.
✗ Call 20 not invoked.
✗ Call 21 not invoked.
✗ Call 22 not invoked.
✗ Call 23 not invoked.
✗ Call 24 not invoked.
✗ Call 25 not invoked.
✗ Call 26 not invoked.
✗ Call 27 not invoked.
✗ Call 28 not invoked.
✗ Call 29 not invoked.
✗ Call 30 not invoked.
✗ Call 31 not invoked.
✗ Call 32 not invoked.
✗ Call 33 not invoked.
✗ Call 34 not invoked.
✗ Call 35 not invoked.
✗ Call 36 not invoked.
3 if (parent_) return parent_->get(name);
22 ✗ return nullptr;
23 }
24 private:
25 const ScopedNamedElementsContainer* parent_;
26 };
27
1/2
✓ Branch 3 taken 104 times.
✗ Branch 4 not taken.
9/9
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
✓ Call 6 invoked.
✓ Call 7 invoked.
✓ Call 8 invoked.
832 SERIALIZE_DERIVED_CONSTRUCTION_T(ScopedNamedElementsContainer, NamedElementsContainer, parent_)
28 }
29
30 #endif //CHRYSALIS_SCOPED_H
31