TerrainGen coverage


terraingen/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
11 / 11
100.0%
Branches:
12 / 12
100.0%
Functions:
1 / 1
100.0%

distribution/moore.cpp
Line Branch Exec Source
1 #include "terraingen/distribution/moore.h"
2
3 #include <cmath>
4
5 namespace terraingen {
6
7 15 PiecewisePowerLawSfd MooreDistribution(MooreTerrain terrain) {
8 15 constexpr double kRoundingTolerance = 5e-3;
9
4/4
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 5 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 2 times.
15 switch (terrain) {
10 6 case MooreTerrain::RoughMare:
11 return PiecewisePowerLawSfd({{0.0, 0.1, 2.0}, {100.0, 10.0, 3.0}}, SfdKind::Density,
12
2/2
✓ Branch 2 taken 6 times.
✓ Branch 5 taken 6 times.
18 DiameterRange{}, false, kRoundingTolerance);
13 5 case MooreTerrain::SmoothMare:
14 return PiecewisePowerLawSfd({{0.0, 0.1, 2.0},
15 {40.0, std::pow(10.0, 0.602), 3.0},
16 {100.0, std::pow(10.0, -2.038), 1.68},
17 {200.0, 10.0, 3.0}},
18
2/2
✓ Branch 2 taken 5 times.
✓ Branch 5 taken 5 times.
15 SfdKind::Density, DiameterRange{}, false, kRoundingTolerance);
19 2 case MooreTerrain::Uplands:
20 return PiecewisePowerLawSfd({{0.0, 0.1, 2.0}, {1000.0, 100.0, 3.0}}, SfdKind::Density,
21
2/2
✓ Branch 2 taken 2 times.
✓ Branch 5 taken 2 times.
6 DiameterRange{}, false, kRoundingTolerance);
22 2 default:
23 return PiecewisePowerLawSfd({{0.0, 0.1, 2.0}}, SfdKind::Density,
24
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
6 DiameterRange{0.0, 10000.0});
25 }
26 }
27
28 } // namespace terraingen
29