From 78d780cc2bc3af66be0bd4c8e8bf80f2dae5bfd3 Mon Sep 17 00:00:00 2001
From: Felix Riehn <felix@matilda>
Date: Tue, 5 Apr 2022 19:22:08 +0100
Subject: [PATCH] make sibyll tests independent of random number state

---
 tests/modules/testSibyll.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/modules/testSibyll.cpp b/tests/modules/testSibyll.cpp
index dffba30ca..36f188e9a 100644
--- a/tests/modules/testSibyll.cpp
+++ b/tests/modules/testSibyll.cpp
@@ -106,7 +106,7 @@ auto sumMomentum(TStackView const& view, CoordinateSystemPtr const& vCS) {
 
 TEST_CASE("SibyllInterface", "modules") {
 
-  logging::set_level(logging::level::trace);
+  logging::set_level(logging::level::info);
 
   // the environment and stack should eventually disappear from here
   auto [env, csPtr, nodePtr] = setup::testing::setup_environment(Code::Oxygen);
@@ -266,8 +266,8 @@ TEST_CASE("SibyllInterface", "modules") {
                                 MomentumVector(cs, {0_eV, 0_eV, 0_eV}));
     model.doInteraction(view, pid, Code::Oxygen, P4, targetP4);
     CrossSectionType const cx = model.getCrossSection(pid, Code::Oxygen, P4, targetP4);
-    CHECK(cx / 1_mb == Approx(1250).margin(100));     // this is not physics validation
-    CHECK(view.getSize() == Approx(150).margin(140)); // this is not physics validation
+    CHECK(cx / 1_mb > 0);       // this is not physics validation
+    CHECK(view.getSize() != 0); // this is not physics validation
 
     // invalid to underlying model
     FourMomentum P4mu(
@@ -321,8 +321,8 @@ TEST_CASE("SibyllDecayInterface", "modules") {
     CHECK(time == get_lifetime(Code::Lambda0) * gamma);
     model.doDecay(view);
     // run checks
-    // lambda decays into proton and pi- or neutron and pi+
-    CHECK(stack.getEntries() == 3);
+    // not physics validation, just check doDecay finished with something
+    CHECK(stack.getEntries() > 1);
   }
 
   SECTION("DecayInterface - decay not handled") {
-- 
GitLab