diff --git a/dune/xt/common/test/common.hh b/dune/xt/common/test/common.hh index c4c45d2220e0883475114136ab71f9d2bdd79961..aeeaa294a9525c7363837ba47eba1a2c88c76b71 100644 --- a/dune/xt/common/test/common.hh +++ b/dune/xt/common/test/common.hh @@ -80,13 +80,15 @@ void print_collected_eoc_study_results(const std::map<std::string, std::vector<d unsigned int grid_elements(); template <typename T> -static typename std::enable_if<Common::is_vector<T>::value, T>::type init_bound(typename Common::VectorAbstraction<T>::S val) +static typename std::enable_if<Common::is_vector<T>::value, T>::type +init_bound(typename Common::VectorAbstraction<T>::S val) { const auto size = Common::VectorAbstraction<T>::has_static_size ? Common::VectorAbstraction<T>::static_size : 3u; return Common::VectorAbstraction<T>::create(size, val); } template <typename T> -static typename std::enable_if<!Common::is_vector<T>::value, T>::type init_bound(typename Common::VectorAbstraction<T>::S val) +static typename std::enable_if<!Common::is_vector<T>::value, T>::type +init_bound(typename Common::VectorAbstraction<T>::S val) { return T(val); } diff --git a/dune/xt/common/test/memory.cc b/dune/xt/common/test/memory.cc index 642d6c87dea5e348e54e57d12c8041fc027e3297..3de1f64a0f3f4804c63ae6114e7c3f313a80fa3e 100644 --- a/dune/xt/common/test/memory.cc +++ b/dune/xt/common/test/memory.cc @@ -23,19 +23,22 @@ struct ScopeTest : public testing::Test typedef int T; static constexpr T constant = 1; template <class P> - void deref(P& p) { + void deref(P& p) + { EXPECT_NE(p, nullptr); auto g = *p; EXPECT_EQ(constant, g); } template <template <class F> class Provider, class P> - void scope(P& p) { + void scope(P& p) + { Provider<T> shared_provider(p); deref(p); } - void check_shared() { + void check_shared() + { auto shared = std::make_shared<T>(constant); scope<ConstStorageProvider>(shared); deref(shared); diff --git a/dune/xt/common/test/random.cc b/dune/xt/common/test/random.cc index b9c9535967e787e3877f5d2b05c3ed648eda7bb7..c2f2ab59f75d0dfdaa51a0cd9f7eb01ae9c5999c 100644 --- a/dune/xt/common/test/random.cc +++ b/dune/xt/common/test/random.cc @@ -27,20 +27,20 @@ TEST(Init, Random) { typedef RNG_FIELD_TYPE T; typedef DefaultRNG<T> RNG; -// typedef typename VectorAbstraction<T>::S Scalar; + // typedef typename VectorAbstraction<T>::S Scalar; const auto lower_bound = init_bound<T>(1); // for the int check we need at least on int in between lower and upper bound const auto upper_bound = init_bound<T>(3); - const auto seed = init_bound<T>(0); + const auto seed = init_bound<T>(0); RNG rng1; RNG rng2(lower_bound); RNG rng3(lower_bound, upper_bound); RNG rng4(lower_bound, upper_bound, seed); - for(auto& r : std::array<RNG, 3>{{rng2, rng3, rng4}}) { + for (auto& r : std::array<RNG, 3>{{rng2, rng3, rng4}}) { const auto val = r(); EXPECT_TRUE(FloatCmp::ge(val, lower_bound)); } - for(auto& r : std::array<RNG, 2>{{rng3, rng4}}) { + for (auto& r : std::array<RNG, 2>{{rng3, rng4}}) { const auto val = r(); EXPECT_TRUE(FloatCmp::le(val, upper_bound)); } @@ -55,4 +55,3 @@ TEST(Init, Random) std::string rstr = str_rng(); EXPECT_EQ(rstr.size(), 2); } - diff --git a/dune/xt/common/test/validation.cc b/dune/xt/common/test/validation.cc index 2c0b9f3fba89140a56f022dd6ccc604fc73ab40e..303f7ff1c553296bb6f3da3d4ab94a398e3b3468 100644 --- a/dune/xt/common/test/validation.cc +++ b/dune/xt/common/test/validation.cc @@ -48,7 +48,7 @@ struct ValidationTest : public testing::Test { typedef VectorAbstraction<T>::S S; const auto scalar_eps = Epsilon<S>::value; - const T lower = init_bound<T>(std::numeric_limits<S>::min() + scalar_eps); + const T lower = init_bound<T>(std::numeric_limits<S>::min() + scalar_eps); const T upper = init_bound<T>(std::numeric_limits<S>::max() - scalar_eps); RNGType rng(lower, upper); for (int i = samples; i > 0; --i) { diff --git a/dune/xt/common/validation.hh b/dune/xt/common/validation.hh index be5976202e83766ab41f667e111468d5f084e47c..0c1e969b95c831828359181a6213f05bf6af247e 100644 --- a/dune/xt/common/validation.hh +++ b/dune/xt/common/validation.hh @@ -124,8 +124,7 @@ public: std::string msg(const T& value) const { - return (boost::format("given value %s was invalid: not less than %s") % to_string(value) % to_string(lhs_)) - .str(); + return (boost::format("given value %s was invalid: not less than %s") % to_string(value) % to_string(lhs_)).str(); } private: