diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-02-16 19:07:56 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-02-16 21:16:12 +0000 |
commit | df5995b0bf9db2a68dc64f0dda1cc74ab222a1f2 (patch) | |
tree | 23d62b841c330ffe73c71b14b210005607c4f1d3 /o3tl | |
parent | 5884a122dc2a2c73865efdbdd861c281475a681e (diff) |
Only specialize CppUnit::assetion_traits<T>::toString member functions
...not the whole CppUnit::assetion_traits<T> 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 <sbergman@redhat.com>
Diffstat (limited to 'o3tl')
-rw-r--r-- | o3tl/qa/test-string_view.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
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<std::u16string_view>::toString(std::u16string_view const& x) { -template <> struct assertion_traits<std::u16string_view> -{ - 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 |