Skip to content
Snippets Groups Projects
Commit 9b661a16 authored by René Fritze's avatar René Fritze
Browse files

Merge branch 'master' into travis

parents dc6154b5 136fe069
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,13 @@
#include <Eigen/Core>
#endif
// some assertions only make sense if dune-fem's threading manager is non-trivial
#if defined(USE_PTHREADS) || defined(_OPENMP)
#define WITH_DUNE_FEM_AND_THREADING(expr) WITH_DUNE_FEM(expr)
#else
#define WITH_DUNE_FEM_AND_THREADING(expr)
#endif
#if HAVE_TBB
#include <thread>
......@@ -27,14 +34,14 @@
size_t Dune::Stuff::ThreadManager::max_threads()
{
const auto threads = DSC_CONFIG_GET("threading.max_count", 1);
WITH_DUNE_FEM(assert(Dune::Fem::ThreadManager::maxThreads() == threads);)
WITH_DUNE_FEM_AND_THREADING(assert(Dune::Fem::ThreadManager::maxThreads() == threads);)
return threads;
}
size_t Dune::Stuff::ThreadManager::current_threads()
{
const auto threads = max_threads();
WITH_DUNE_FEM(assert(long(Dune::Fem::ThreadManager::currentThreads()) == long(threads));)
WITH_DUNE_FEM_AND_THREADING(assert(long(Dune::Fem::ThreadManager::currentThreads()) == long(threads));)
return threads;
}
......
......@@ -32,7 +32,7 @@ struct MatrixStringTestDouble : public ::testing::Test
{
void check() const
{
EXPECT_EQ("[1.000000 2.000000; 3.000000 4.000000]", toString(fromString<MatrixType>("[1.0 2; 3.0 4]")));
EXPECT_EQ("[1 2; 3 4]", toString(fromString<MatrixType>("[1.0 2; 3.0 4]")));
EXPECT_THROW(fromString<MatrixType>("[1 2; 3 4]", 3, 3), Dune::Stuff::Exceptions::conversion_error);
}
};
......@@ -52,7 +52,7 @@ struct VectorStringTestDouble : public ::testing::Test
{
void check() const
{
EXPECT_EQ("[1.000000 2.000000 3.000000]", toString(fromString<VectorType>("[1.0 2 3.0]")));
EXPECT_EQ("[1 2 3]", toString(fromString<VectorType>("[1.0 2 3.0]")));
EXPECT_THROW(fromString<VectorType>("[1.0 2 3.0]", 4), Dune::Stuff::Exceptions::conversion_error);
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment