From 701e49a62d2a905380788af7b409899038807962 Mon Sep 17 00:00:00 2001
From: Randolf Beerwerth <r.beerwerth@fz-juelich.de>
Date: Tue, 22 Sep 2020 15:34:17 +0200
Subject: [PATCH] make test sensitive to cutoff issues

---
 Tests/UnitTests/Core/Fresnel/SpecularMagneticTest.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Tests/UnitTests/Core/Fresnel/SpecularMagneticTest.cpp b/Tests/UnitTests/Core/Fresnel/SpecularMagneticTest.cpp
index 7b9c3195bc2..03a435c7cb3 100644
--- a/Tests/UnitTests/Core/Fresnel/SpecularMagneticTest.cpp
+++ b/Tests/UnitTests/Core/Fresnel/SpecularMagneticTest.cpp
@@ -9,6 +9,7 @@
 #include "Core/Parametrization/SimulationOptions.h"
 #include "Tests/GTestWrapper/google_test.h"
 #include <utility>
+#include "Core/Multilayer/KzComputation.h"
 
 constexpr double eps = 1e-10;
 
@@ -56,8 +57,10 @@ void SpecularMagneticTest::testZeroField(const kvector_t& k, const ProcessedSamp
                                          const ProcessedSample& sample_zerofield)
 {
     auto coeffs_scalar =
-        std::make_unique<SpecularScalarTanhStrategy>()->Execute(sample_scalar.slices(), k);
-    auto coeffs_zerofield = std::make_unique<Strategy>()->Execute(sample_zerofield.slices(), k);
+        std::make_unique<SpecularScalarTanhStrategy>()->Execute(sample_scalar.slices(),
+                                            KzComputation::computeKzFromRefIndices(sample_scalar.slices(), k) );
+    auto coeffs_zerofield = std::make_unique<Strategy>()->Execute(sample_zerofield.slices(),
+                                            KzComputation::computeKzFromRefIndices(sample_zerofield.slices(), k) );
 
     EXPECT_EQ(coeffs_scalar.size(), coeffs_zerofield.size());
 
@@ -146,5 +149,5 @@ TEST_F(SpecularMagneticTest, zerofield)
 
 TEST_F(SpecularMagneticTest, zerofield_new)
 {
-    testcase_zerofield<SpecularMagneticNewTanhStrategy>({-0.0, -0.1, -2.0, -10.0});
+    testcase_zerofield<SpecularMagneticNewTanhStrategy>({-0.0, -1.e-9, -1.e-5, -0.1, -2.0, -10.0});
 }
-- 
GitLab