From df5995b0bf9db2a68dc64f0dda1cc74ab222a1f2 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 16 Feb 2023 19:07:56 +0100 Subject: Only specialize CppUnit::assetion_traits::toString member functions ...not the whole CppUnit::assetion_traits classes (where applicable). That avoids spelling out the (identical) equals member functions, and also leaves around the less and lessEqual member functions, in case they want to be used after all. Change-Id: I18f8d6cff0353921ced4952b33a0c85ff8292923 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147165 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- o3tl/qa/test-string_view.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'o3tl') diff --git a/o3tl/qa/test-string_view.cxx b/o3tl/qa/test-string_view.cxx index 0cc753795df2..37cb4118a8e2 100644 --- a/o3tl/qa/test-string_view.cxx +++ b/o3tl/qa/test-string_view.cxx @@ -23,17 +23,11 @@ // gcc 11.2.0 triggers a spurious -Werror=stringop-overread #if !(defined __GNUC__ && __GNUC__ == 11 && __GNUC_MINOR__ == 2) -namespace CppUnit +template <> +inline std::string +CppUnit::assertion_traits::toString(std::u16string_view const& x) { -template <> struct assertion_traits -{ - static bool equal(std::u16string_view x, std::u16string_view y) { return x == y; } - - static std::string toString(std::u16string_view x) - { - return OUStringToOString(x, RTL_TEXTENCODING_UTF8).getStr(); - } -}; + return OUStringToOString(x, RTL_TEXTENCODING_UTF8).getStr(); } namespace -- cgit