IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 14dfbba2 authored by ralfulrich's avatar ralfulrich Committed by Ralf Ulrich
Browse files

increase test coverage and style

parent 0932eb0d
No related branches found
No related tags found
No related merge requests found
...@@ -97,7 +97,7 @@ namespace corsika { ...@@ -97,7 +97,7 @@ namespace corsika {
return components_[iChannel]; return components_[iChannel];
} }
// Note: when this class ever modifies its internal data, the hash // Note: when this class ever modifies its internal data, the hash
// must be updated, too! // must be updated, too!
inline size_t NuclearComposition::getHash() const { return hash_; } inline size_t NuclearComposition::getHash() const { return hash_; }
......
...@@ -63,7 +63,7 @@ namespace corsika { ...@@ -63,7 +63,7 @@ namespace corsika {
Code sampleTarget(std::vector<CrossSectionType> const& sigma, Code sampleTarget(std::vector<CrossSectionType> const& sigma,
TRNG& randomStream) const; TRNG& randomStream) const;
// Note: when this class ever modifies its internal data, the hash // Note: when this class ever modifies its internal data, the hash
// must be updated, too! // must be updated, too!
size_t getHash() const; size_t getHash() const;
......
...@@ -220,7 +220,7 @@ TEST_CASE("InhomogeneousMedium") { ...@@ -220,7 +220,7 @@ TEST_CASE("InhomogeneousMedium") {
CHECK(rho.getArclengthFromGrammage(trajectory, 20_g / (1_cm * 1_cm)) == CHECK(rho.getArclengthFromGrammage(trajectory, 20_g / (1_cm * 1_cm)) ==
inhMedium.getArclengthFromGrammage(trajectory, 20_g / (1_cm * 1_cm))); inhMedium.getArclengthFromGrammage(trajectory, 20_g / (1_cm * 1_cm)));
CHECK(inhMedium.getNuclearComposition() == composition); CHECK(inhMedium.getNuclearComposition() == composition);
CHECK(inhMedium.getMassDensity({gCS, {0_m, 0_m, 0_m}}) == 1_kg/static_pow<3>(1_m)); CHECK(inhMedium.getMassDensity({gCS, {0_m, 0_m, 0_m}}) == 1_kg / static_pow<3>(1_m));
} }
} }
...@@ -240,7 +240,7 @@ TEST_CASE("LayeredSphericalAtmosphereBuilder") { ...@@ -240,7 +240,7 @@ TEST_CASE("LayeredSphericalAtmosphereBuilder") {
builder.addExponentialLayer(540.1778_g / (1_cm * 1_cm), 772170.16_cm, 30_km); builder.addExponentialLayer(540.1778_g / (1_cm * 1_cm), 772170.16_cm, 30_km);
CHECK_THROWS(builder.addLinearLayer(0.5_km, 5_km)); CHECK_THROWS(builder.addLinearLayer(0.5_km, 5_km));
CHECK(builder.getSize() == 3); CHECK(builder.getSize() == 3);
auto const builtEnv = builder.assemble(); auto const builtEnv = builder.assemble();
...@@ -307,7 +307,7 @@ TEST_CASE("LayeredSphericalAtmosphereBuilder w/ magnetic field") { ...@@ -307,7 +307,7 @@ TEST_CASE("LayeredSphericalAtmosphereBuilder w/ magnetic field") {
->getModelProperties() ->getModelProperties()
.getMagneticField(pTest2) .getMagneticField(pTest2)
.getComponents(gCS)); .getComponents(gCS));
} }
TEST_CASE("media", "LayeredSphericalAtmosphereBuilder USStd") { TEST_CASE("media", "LayeredSphericalAtmosphereBuilder USStd") {
// setup environment, geometry // setup environment, geometry
......
...@@ -63,7 +63,7 @@ TEST_CASE("Homogeneous Density") { ...@@ -63,7 +63,7 @@ TEST_CASE("Homogeneous Density") {
ShowerAxis const showerAxis{injectionPos, (showerCore - injectionPos), *env, ShowerAxis const showerAxis{injectionPos, (showerCore - injectionPos), *env,
true, // -> do not throw exceptions true, // -> do not throw exceptions
20}; // -> number of bins 20}; // -> number of bins
CHECK(showerAxis.getSteplength() == 500_m); CHECK(showerAxis.getSteplength() == 500_m);
...@@ -82,5 +82,5 @@ TEST_CASE("Homogeneous Density") { ...@@ -82,5 +82,5 @@ TEST_CASE("Homogeneous Density") {
CHECK(showerAxis.getStart().getCoordinates() == injectionPos.getCoordinates()); CHECK(showerAxis.getStart().getCoordinates() == injectionPos.getCoordinates());
CHECK_THROWS(showerAxis.getX(-1_m)); CHECK_THROWS(showerAxis.getX(-1_m));
CHECK_THROWS(showerAxis.getX((injectionPos-showerCore).getNorm()+1_m)); CHECK_THROWS(showerAxis.getX((injectionPos - showerCore).getNorm() + 1_m));
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment