TerrainGen coverage


terraingen/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
14 / 14
100.0%
Branches:
13 / 15
86.7%
Functions:
1 / 1
100.0%

layers/craters/shaping/prepared.cpp
Line Branch Exec Source
1 #include "terraingen/layers/craters/shaping/prepared.h"
2
3 #include <utility>
4
5 namespace terraingen {
6
7 std::vector<PreparedCrater>
8 129837 PrepareCraters(const CraterList& craters, const CraterApplyOptions& options, double spacing,
9 const DegradationModel& degradation,
10 const std::function<void(const Crater&, CraterOutline&)>& reshape) {
11 129837 std::vector<PreparedCrater> prepared;
12
3/3
✓ Branch 1 taken 129837 times.
✓ Branch 8 taken 6693097 times.
✓ Branch 9 taken 129837 times.
6822934 for (const std::size_t index : CraterApplyOrder(craters, options.order)) {
13
1/1
✓ Branch 1 taken 6693097 times.
6693097 const Crater crater = craters.At(index);
14
1/1
✓ Branch 1 taken 6693097 times.
6693097 const double resolution = ResolutionWeight(crater.diameter, spacing, options.fade);
15
2/2
✓ Branch 0 taken 950286 times.
✓ Branch 1 taken 5742811 times.
6693097 if (resolution == 0.0) {
16 950286 continue;
17 }
18
1/1
✓ Branch 1 taken 5742811 times.
5742811 CraterOutline outline = OutlineOf(crater, options.irregularity);
19
2/2
✓ Branch 1 taken 1480 times.
✓ Branch 2 taken 5741331 times.
5742811 if (reshape) {
20
1/1
✓ Branch 1 taken 1480 times.
1480 reshape(crater, outline);
21 }
22 11485622 prepared.push_back({crater, resolution, degradation.State(crater), std::move(outline)});
23 5872648 }
24 129837 return prepared;
25
2/4
✓ Branch 1 taken 5742811 times.
✓ Branch 6 taken 5742811 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
11485622 }
26
27 } // namespace terraingen
28