From 991a596b7afb58af337ef40ed125ac9109554a54 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Thu, 15 Apr 2021 16:58:00 +0200
Subject: [PATCH] Fixed warnings in Tests.

---
 Tests/GeoLib/TestDuplicateGeometry.cpp                      | 2 +-
 Tests/MaterialLib/TestFractureModels.cpp                    | 6 +++---
 .../TestMPLCapillaryPressureRegularizedVanGenuchten.cpp     | 1 -
 .../TestMPLRelPermNonWettingPhaseVanGenuchtenMualem.cpp     | 2 --
 Tests/MaterialLib/TestMPLRelPermUdell.cpp                   | 1 -
 Tests/MeshLib/TestPyramidQualityCriteria.cpp                | 2 +-
 Tests/MeshLib/TestTetQualityCriteria.cpp                    | 4 ++--
 Tests/NumLib/NewtonRaphson.cpp                              | 2 +-
 8 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/Tests/GeoLib/TestDuplicateGeometry.cpp b/Tests/GeoLib/TestDuplicateGeometry.cpp
index 772bd306465..a9a1786774b 100644
--- a/Tests/GeoLib/TestDuplicateGeometry.cpp
+++ b/Tests/GeoLib/TestDuplicateGeometry.cpp
@@ -124,7 +124,7 @@ TEST(GeoLib, DuplicateGeometry)
         auto sfcs = std::make_unique<std::vector<GeoLib::Surface*>>();
         for (int i = 0; i < n_sfcs; ++i)
         {
-            int const n_tris = std::rand() % 10 + 1;
+            size_t const n_tris = std::rand() % 10 + 1;
             auto* sfc = new GeoLib::Surface(*geo.getPointVec(input_name));
             while (sfc->getNumberOfTriangles() <= n_tris)
             {
diff --git a/Tests/MaterialLib/TestFractureModels.cpp b/Tests/MaterialLib/TestFractureModels.cpp
index 251899047ac..9715fafe22b 100644
--- a/Tests/MaterialLib/TestFractureModels.cpp
+++ b/Tests/MaterialLib/TestFractureModels.cpp
@@ -27,7 +27,7 @@ constexpr double eps_sigma = 1e6 * eps;
 constexpr double eps_C = 2e10 * eps;
 
 static NumLib::NewtonRaphsonSolverParameters const nonlinear_solver_parameters{
-    1000, 1e-16};
+    1000, 1e-16, 0.0};
 
 TEST(MaterialLib_Fracture, LinearElasticIsotropic)
 {
@@ -364,7 +364,7 @@ TEST(MaterialLib_Fracture, Coulomb3D_negative_t1t2)
     double const penalty_aperture_cutoff = aperture0;
     bool const tension_cutoff = true;
     Coulomb::Coulomb<3> fractureModel{
-        {1000, 1e-9}, penalty_aperture_cutoff, tension_cutoff, mp};
+        {1000, 1e-9, 0.0}, penalty_aperture_cutoff, tension_cutoff, mp};
     std::unique_ptr<FractureModelBase<3>::MaterialStateVariables> state(
         fractureModel.createMaterialStateVariables());
     state->pushBackState();
@@ -414,7 +414,7 @@ TEST(MaterialLib_Fracture, Coulomb3D_negative_t1_positive_t2)
     bool const tension_cutoff = true;
 
     Coulomb::Coulomb<3> fractureModel{
-        {1000, 1e-9}, penalty_aperture_cutoff, tension_cutoff, mp};
+        {1000, 1e-9, 0.0}, penalty_aperture_cutoff, tension_cutoff, mp};
     std::unique_ptr<FractureModelBase<3>::MaterialStateVariables> state(
         fractureModel.createMaterialStateVariables());
     state->pushBackState();
diff --git a/Tests/MaterialLib/TestMPLCapillaryPressureRegularizedVanGenuchten.cpp b/Tests/MaterialLib/TestMPLCapillaryPressureRegularizedVanGenuchten.cpp
index e06a8147ccc..1b0efcde235 100644
--- a/Tests/MaterialLib/TestMPLCapillaryPressureRegularizedVanGenuchten.cpp
+++ b/Tests/MaterialLib/TestMPLCapillaryPressureRegularizedVanGenuchten.cpp
@@ -43,7 +43,6 @@ TEST(MaterialPropertyLib, CapillaryPressureRegularizedVanGenuchten)
         *capillary_pressure_property_ptr;
 
     double const Sl_r = 0.1;
-    double const Sl_max = 0.95;
 
     MPL::VariableArray variable_array;
     ParameterLib::SpatialPosition const pos;
diff --git a/Tests/MaterialLib/TestMPLRelPermNonWettingPhaseVanGenuchtenMualem.cpp b/Tests/MaterialLib/TestMPLRelPermNonWettingPhaseVanGenuchtenMualem.cpp
index ac58c7dcb68..9d62825607a 100644
--- a/Tests/MaterialLib/TestMPLRelPermNonWettingPhaseVanGenuchtenMualem.cpp
+++ b/Tests/MaterialLib/TestMPLRelPermNonWettingPhaseVanGenuchtenMualem.cpp
@@ -61,8 +61,6 @@ TEST(MaterialPropertyLib, RelPermNonWettingPhaseVanGenuchtenMualem)
                                                1.0e-9,
                                                1.0e-9};
 
-    const double S_n_r = 0.05;
-    const double S_n_max = 0.9;
     const double S_L_r = 0.1;     // 1.0 - S_n_max;
     const double S_L_max = 0.95;  // 1.0 - S_n_r;
     for (std::size_t i = 0; i < S_L.size(); i++)
diff --git a/Tests/MaterialLib/TestMPLRelPermUdell.cpp b/Tests/MaterialLib/TestMPLRelPermUdell.cpp
index cd3c5a95a6a..08eac2137cc 100644
--- a/Tests/MaterialLib/TestMPLRelPermUdell.cpp
+++ b/Tests/MaterialLib/TestMPLRelPermUdell.cpp
@@ -54,7 +54,6 @@ TEST(MaterialPropertyLib, RelPermUdellDerivatives)
          s_L += stepsize)
     {
         // Wetting phase
-        bool nonwetting_phase = false;
         const std::stringstream m =
             configRelPermUdell(ref_residual_liquid_saturation,
                                ref_residual_gas_saturation, ref_k_rel_L_min);
diff --git a/Tests/MeshLib/TestPyramidQualityCriteria.cpp b/Tests/MeshLib/TestPyramidQualityCriteria.cpp
index 3e3d8fb62db..7e88e53bff3 100644
--- a/Tests/MeshLib/TestPyramidQualityCriteria.cpp
+++ b/Tests/MeshLib/TestPyramidQualityCriteria.cpp
@@ -117,7 +117,7 @@ TEST_F(PyramidElementQuality, EdgeRatio)
         edge_lengths_front_back.begin(), edge_lengths_front_back.end());
     auto const expected_value_front_back =
         *min_max_front_back.first / *min_max_front_back.second;
-    for (int i = 0; i < element_quality_vector.size(); i = i + 6)
+    for (size_t i = 0; i < element_quality_vector.size(); i = i + 6)
     {
         ASSERT_NEAR(expected_value_top_bottom, element_quality_vector[i],
                     10 * std::numeric_limits<double>::epsilon());
diff --git a/Tests/MeshLib/TestTetQualityCriteria.cpp b/Tests/MeshLib/TestTetQualityCriteria.cpp
index 34eed0b480d..3b090f4a5c6 100644
--- a/Tests/MeshLib/TestTetQualityCriteria.cpp
+++ b/Tests/MeshLib/TestTetQualityCriteria.cpp
@@ -107,7 +107,7 @@ TEST_F(TetElementQuality, EdgeRatio)
     auto const expected_value_tet4 = expected_value_tet1;
     auto const expected_value_tet5 = expected_value_tet0;
 
-    for (int i = 0; i < element_quality_vector.size(); i = i + 6)
+    for (size_t i = 0; i < element_quality_vector.size(); i = i + 6)
     {
         ASSERT_NEAR(expected_value_tet0, element_quality_vector[i],
                     10 * std::numeric_limits<double>::epsilon());
@@ -191,7 +191,7 @@ TEST_F(TetElementQuality, EquiAngleSkew)
     auto const expected_value_tet5 = computeCriterionForTet(n3, n4, n5, n7);
 
     auto constexpr eps = 11 * std::numeric_limits<double>::epsilon();
-    for (int i = 0; i < element_quality_vector.size(); i = i + 6)
+    for (size_t i = 0; i < element_quality_vector.size(); i = i + 6)
     {
         ASSERT_NEAR(expected_value_tet0, element_quality_vector[i], eps);
         ASSERT_NEAR(expected_value_tet1, element_quality_vector[i + 1], eps);
diff --git a/Tests/NumLib/NewtonRaphson.cpp b/Tests/NumLib/NewtonRaphson.cpp
index 967abc6898c..5335ffe2bad 100644
--- a/Tests/NumLib/NewtonRaphson.cpp
+++ b/Tests/NumLib/NewtonRaphson.cpp
@@ -48,7 +48,7 @@ TEST(NumLibNewtonRaphson, Sqrt3)
                               decltype(update_residual),
                               decltype(update_solution)>(
             linear_solver, update_jacobian, update_residual, update_solution,
-            {maximum_iterations, tolerance});
+            {maximum_iterations, tolerance, 0.0});
     auto const success_iterations = newton_solver.solve(jacobian);
 
     EXPECT_TRUE(static_cast<bool>(success_iterations));
-- 
GitLab