From bd645bed63ec846fbeeaa1564405c3861fac8109 Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Thu, 9 Dec 2021 20:45:03 +0100 Subject: [PATCH] improve test coverage --- corsika/modules/conex/Random.hpp | 4 +++- tests/modules/testQGSJetII.cpp | 3 +++ tests/modules/testTracking.cpp | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/corsika/modules/conex/Random.hpp b/corsika/modules/conex/Random.hpp index 9532eace8..31e64361d 100644 --- a/corsika/modules/conex/Random.hpp +++ b/corsika/modules/conex/Random.hpp @@ -15,7 +15,7 @@ * \file conex/Random.hpp * * This file is an integral part of the epos interface. It must be - * linked to the executable linked to epos exactly once + * linked to the executable linked to epos exactly once. * * Note, that the fortran random numbe interface functions are all * defined in the epos corsika 8 interface: @@ -34,6 +34,7 @@ namespace conex { + // GCOV_EXCL_START : we don't want to unit-test the random interface float rndm_interface() { static corsika::default_prng_type& rng = corsika::RNGManager<>::getInstance().getRandomStream("conex"); @@ -47,5 +48,6 @@ namespace conex { std::uniform_real_distribution<double> dist; return dist(rng); } + // GCOV_EXCL_STOP } // namespace conex diff --git a/tests/modules/testQGSJetII.cpp b/tests/modules/testQGSJetII.cpp index e9caaecf8..f39fecc1f 100644 --- a/tests/modules/testQGSJetII.cpp +++ b/tests/modules/testQGSJetII.cpp @@ -99,6 +99,9 @@ TEST_CASE("QgsjetII", "[processes]") { CHECK_FALSE(model.isValid(Code::Electron, Code::Proton, 1_TeV)); CHECK_FALSE(model.isValid(Code::Proton, Code::Electron, 1_TeV)); CHECK_FALSE(model.isValid(Code::Proton, Code::Proton, 1_GeV)); + + CHECK(model.isValid(Code::Proton, Code::Helium, 1_TeV)); + CHECK_FALSE(model.isValid(Code::Proton, Code::Helium, 1_GeV)); } } diff --git a/tests/modules/testTracking.cpp b/tests/modules/testTracking.cpp index 4906bc58c..02de43482 100644 --- a/tests/modules/testTracking.cpp +++ b/tests/modules/testTracking.cpp @@ -394,3 +394,10 @@ TEMPLATE_TEST_CASE("TrackingPlane", "plane", tracking_leapfrog_curved::Tracking, CHECK(hit.getExit() == 1_s * std::numeric_limits<double>::infinity()); } } + +TEST_CASE("Intersections") { + Intersections test; + CHECK(test.getEntry() == + std::numeric_limits<TimeType::value_type>::infinity() * second); + CHECK(test.getExit() == std::numeric_limits<TimeType::value_type>::infinity() * second); +} -- GitLab