TerrainGen coverage


terraingen/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
10 / 10
100.0%
Branches:
8 / 9
88.9%
Functions:
2 / 2
100.0%

layers/craters/crater_placer.cpp
Line Branch Exec Source
1 #include "terraingen/layers/craters/crater_placer.h"
2
3 namespace terraingen {
4
5 132 void CraterFeatures::Append(const CraterFeatures& other) {
6 132 craters.Append(other.craters);
7
1/1
✓ Branch 5 taken 132 times.
132 attributes.insert(attributes.end(), other.attributes.begin(), other.attributes.end());
8 132 }
9
10 119 CraterFeatures PlacedCraters(std::span<const std::shared_ptr<const Layer>> layers,
11 const RasterGrid& grid, double spacing) {
12 119 CraterFeatures placed;
13
2/2
✓ Branch 5 taken 237 times.
✓ Branch 6 taken 119 times.
356 for (const auto& layer : layers) {
14
3/4
✓ Branch 1 taken 237 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 132 times.
✓ Branch 4 taken 105 times.
237 if (const auto* placer = dynamic_cast<const CraterPlacer*>(layer.get())) {
15
2/2
✓ Branch 1 taken 132 times.
✓ Branch 4 taken 132 times.
132 placed.Append(placer->CratersOver(grid, spacing));
16 }
17 }
18 119 return placed;
19 }
20
21 } // namespace terraingen
22