diff --git a/dune/xt/common/test/validation.cc b/dune/xt/common/test/validation.cc index 2c0b9f3fba89140a56f022dd6ccc604fc73ab40e..3cbd59281443b19e3f4f931adecc39749817eb07 100644 --- a/dune/xt/common/test/validation.cc +++ b/dune/xt/common/test/validation.cc @@ -42,19 +42,16 @@ struct ValidationTest : public testing::Test void all() { using namespace boost::assign; - const int samples = 100; - std::cout << "\tTesting Validators for type " << Typename<T>::value() << "\n\t\t" << samples - << " random numbers ..." << std::endl; { 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 upper = init_bound<T>(std::numeric_limits<S>::max() - scalar_eps); - RNGType rng(lower, upper); - for (int i = samples; i > 0; --i) { - const T arg = rng(); + const T lower = init_bound<T>(std::numeric_limits<S>::min() / 6 + scalar_eps); + const T upper = init_bound<T>(std::numeric_limits<S>::max() / 6 - scalar_eps); + + for (auto&& arg : std::array<T, 3>{{lower, T(0), upper}}) { test(lower, upper, arg); } + RNGType rng(lower, upper); boost::array<T, 10> ar = list_of<T>().repeat_fun(9, rng); ValidateInList<T, boost::array<T, 10>> validator(ar); for (T t : ar) { diff --git a/dune/xt/common/validation.hh b/dune/xt/common/validation.hh index 8cd3df6c7613dafc4bfbfc4167ba53f2db7a32a3..64255eea27a31046db77faacb7995f9dedbab027 100644 --- a/dune/xt/common/validation.hh +++ b/dune/xt/common/validation.hh @@ -108,7 +108,7 @@ public: } }; -//! validate arg iff less than value, obviously +//! validate arg iff lhs < rhs template <class T> class ValidateLess : public ValidatorInterface<T, ValidateLess<T>> { @@ -131,7 +131,7 @@ private: const T lhs_; }; -//! validate arg iff greater than value, obviously +//! validate arg iff lhs > rhs, obviously template <class T> class ValidateGreater : public ValidatorInterface<T, ValidateGreater<T>> {