Skip to content
Snippets Groups Projects
Commit 2945400c authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add few missing tests for ReproducibleSumManager

parent 58e35c44
No related branches found
No related tags found
1 merge request!199Integrate checkpointing
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
#ifdef PUGS_HAS_MPI #ifdef PUGS_HAS_MPI
// LCOV_EXCL_START
// This piece of code is not catchable by coverage...
template <typename RSumType> template <typename RSumType>
struct ReproducibleMPIReducer struct ReproducibleMPIReducer
{ {
...@@ -22,6 +25,8 @@ struct ReproducibleMPIReducer ...@@ -22,6 +25,8 @@ struct ReproducibleMPIReducer
} }
}; };
// LCOV_EXCL_STOP
template <typename ArrayT, typename BoolArrayT> template <typename ArrayT, typename BoolArrayT>
auto auto
allReduceReproducibleSum(const ReproducibleScalarSum<ArrayT, BoolArrayT>& s) allReduceReproducibleSum(const ReproducibleScalarSum<ArrayT, BoolArrayT>& s)
......
...@@ -130,6 +130,7 @@ add_executable (unit_tests ...@@ -130,6 +130,7 @@ add_executable (unit_tests
test_QuadratureType.cpp test_QuadratureType.cpp
test_RefId.cpp test_RefId.cpp
test_RefItemList.cpp test_RefItemList.cpp
test_ReproducibleSumManager.cpp
test_RevisionInfo.cpp test_RevisionInfo.cpp
test_SmallArray.cpp test_SmallArray.cpp
test_SmallMatrix.cpp test_SmallMatrix.cpp
......
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers_all.hpp>
#include <utils/ReproducibleSumManager.hpp>
// clazy:excludeall=non-pod-global-static
TEST_CASE("ReproducibleSumManager", "[utils]")
{
SECTION("control settings")
{
const bool init_value = ReproducibleSumManager::reproducibleSums();
ReproducibleSumManager::setReproducibleSums(not init_value);
REQUIRE(init_value == not ReproducibleSumManager::reproducibleSums());
ReproducibleSumManager::setReproducibleSums(init_value);
REQUIRE(init_value == ReproducibleSumManager::reproducibleSums());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment