From: Wolfgang Bangerth Date: Tue, 10 Jan 2023 04:14:05 +0000 (-0700) Subject: Improve grammar in error messages. X-Git-Tag: v9.5.0-rc1~670^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14655%2Fhead;p=dealii.git Improve grammar in error messages. --- diff --git a/include/deal.II/base/array_view.h b/include/deal.II/base/array_view.h index 168310404e..deb64f8913 100644 --- a/include/deal.II/base/array_view.h +++ b/include/deal.II/base/array_view.h @@ -655,10 +655,10 @@ make_array_view(const Iterator begin, const Iterator end) static_assert( std::is_same::iterator_category, typename std::random_access_iterator_tag>::value, - "The provided iterator should be a random access iterator."); + "The provided iterator needs to be a random access iterator."); Assert(begin <= end, ExcMessage( - "The beginning of the array view should be before the end.")); + "The beginning of the array view needs to be before the end.")); Assert(internal::ArrayViewHelper::is_contiguous(begin, end), ExcMessage("The provided range isn't contiguous in memory!")); // the reference type, not the value type, knows the constness of the iterator @@ -684,7 +684,7 @@ make_array_view(ElementType *const begin, ElementType *const end) { Assert(begin <= end, ExcMessage( - "The beginning of the array view should be before the end.")); + "The beginning of the array view needs to be before the end.")); return ArrayView(begin, end - begin); } diff --git a/tests/base/array_view_09.cc b/tests/base/array_view_09.cc index 36bee2e25c..102ce8ac46 100644 --- a/tests/base/array_view_09.cc +++ b/tests/base/array_view_09.cc @@ -63,9 +63,9 @@ test() const std::array &v2 = v; const auto a = make_array_view(v2.begin(), v2.end()); static_assert(is_const_reference(), - "type should be const"); + "type needs to be const"); static_assert(is_const_reference(), - "type should be const"); + "type needs to be const"); v[5] = 10; AssertThrow(a[5] == 10, ExcInternalError()); @@ -76,15 +76,15 @@ test() std::vector v(10); std::fill(v.begin(), v.end(), 42.0); auto a = make_array_view(v.cbegin() + 2, v.cend()); - // a should be ArrayView + // a needs to be ArrayView static_assert(!std::is_const::value, "a should not be const (but has const value)"); static_assert(std::is_const::value, - "a::value_type should be const"); + "a::value_type needs to be const"); static_assert(is_const_reference(), - "type should be const"); + "type needs to be const"); static_assert(is_const_reference(), - "type should be const"); + "type needs to be const"); v[2] = 10.0; AssertThrow(a[0] == v[2], ExcInternalError()); } @@ -100,15 +100,15 @@ test() // static_vector::cbegin() and static_vector::cend() correctly, so ignore // the type checking in that case #if BOOST_VERSION >= 106200 - // a should be const ArrayView + // a needs to be const ArrayView static_assert(std::is_const::value, "a should not be const (but has const value)"); static_assert(std::is_const::value, - "a::value_type should be const"); + "a::value_type needs to be const"); static_assert(is_const_reference(), - "type should be const"); + "type needs to be const"); static_assert(is_const_reference(), - "type should be const"); + "type needs to be const"); #endif v[2] = 10.0; AssertThrow(a[0] == v[2], ExcInternalError()); @@ -127,10 +127,10 @@ test() // to make CTest happy #ifndef DEBUG deallog - << "ExcMessage(\"The beginning of the array view should be before the end.\")" + << "ExcMessage(\"The beginning of the array view needs to be before the end.\")" << std::endl; deallog - << "ExcMessage(\"The beginning of the array view should be before the end.\")" + << "ExcMessage(\"The beginning of the array view needs to be before the end.\")" << std::endl; #endif } diff --git a/tests/base/array_view_09.output b/tests/base/array_view_09.output index 78b054254c..c5e1b02eb2 100644 --- a/tests/base/array_view_09.output +++ b/tests/base/array_view_09.output @@ -1,4 +1,4 @@ -DEAL::ExcMessage("The beginning of the array view should be before the end.") -DEAL::ExcMessage("The beginning of the array view should be before the end.") +DEAL::ExcMessage("The beginning of the array view needs to be before the end.") +DEAL::ExcMessage("The beginning of the array view needs to be before the end.") DEAL::OK