From 14dfbba24fe6a249c273a0fd012d3859f10e93d8 Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Wed, 7 Apr 2021 08:18:57 +0200 Subject: [PATCH] increase test coverage and style --- corsika/detail/media/NuclearComposition.inl | 2 +- corsika/media/NuclearComposition.hpp | 2 +- tests/media/testEnvironment.cpp | 6 +++--- tests/media/testShowerAxis.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/corsika/detail/media/NuclearComposition.inl b/corsika/detail/media/NuclearComposition.inl index 37d8da57d..4995799d5 100644 --- a/corsika/detail/media/NuclearComposition.inl +++ b/corsika/detail/media/NuclearComposition.inl @@ -97,7 +97,7 @@ namespace corsika { 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! inline size_t NuclearComposition::getHash() const { return hash_; } diff --git a/corsika/media/NuclearComposition.hpp b/corsika/media/NuclearComposition.hpp index 9e435adf6..e4ad9513a 100644 --- a/corsika/media/NuclearComposition.hpp +++ b/corsika/media/NuclearComposition.hpp @@ -63,7 +63,7 @@ namespace corsika { Code sampleTarget(std::vector<CrossSectionType> const& sigma, 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! size_t getHash() const; diff --git a/tests/media/testEnvironment.cpp b/tests/media/testEnvironment.cpp index 27f99a61f..3eab2cd6b 100644 --- a/tests/media/testEnvironment.cpp +++ b/tests/media/testEnvironment.cpp @@ -220,7 +220,7 @@ TEST_CASE("InhomogeneousMedium") { CHECK(rho.getArclengthFromGrammage(trajectory, 20_g / (1_cm * 1_cm)) == inhMedium.getArclengthFromGrammage(trajectory, 20_g / (1_cm * 1_cm))); 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") { builder.addExponentialLayer(540.1778_g / (1_cm * 1_cm), 772170.16_cm, 30_km); CHECK_THROWS(builder.addLinearLayer(0.5_km, 5_km)); - + CHECK(builder.getSize() == 3); auto const builtEnv = builder.assemble(); @@ -307,7 +307,7 @@ TEST_CASE("LayeredSphericalAtmosphereBuilder w/ magnetic field") { ->getModelProperties() .getMagneticField(pTest2) .getComponents(gCS)); - } +} TEST_CASE("media", "LayeredSphericalAtmosphereBuilder USStd") { // setup environment, geometry diff --git a/tests/media/testShowerAxis.cpp b/tests/media/testShowerAxis.cpp index bd21f6805..19d7635ae 100644 --- a/tests/media/testShowerAxis.cpp +++ b/tests/media/testShowerAxis.cpp @@ -63,7 +63,7 @@ TEST_CASE("Homogeneous Density") { ShowerAxis const showerAxis{injectionPos, (showerCore - injectionPos), *env, true, // -> do not throw exceptions - 20}; // -> number of bins + 20}; // -> number of bins CHECK(showerAxis.getSteplength() == 500_m); @@ -82,5 +82,5 @@ TEST_CASE("Homogeneous Density") { CHECK(showerAxis.getStart().getCoordinates() == injectionPos.getCoordinates()); CHECK_THROWS(showerAxis.getX(-1_m)); - CHECK_THROWS(showerAxis.getX((injectionPos-showerCore).getNorm()+1_m)); + CHECK_THROWS(showerAxis.getX((injectionPos - showerCore).getNorm() + 1_m)); } -- GitLab