sal/qa/rtl/strings/test_ostring_concat.cxx | 14 ++++++++------ sal/qa/rtl/strings/test_oustring_concat.cxx | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-)
New commits: commit ad4c7b97752b4da73808402604d6f96b39d920f5 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue Aug 27 09:06:31 2019 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Tue Aug 27 15:16:29 2019 +0200 Avoid declaring function templates in namespace std ...that don't even depend on program-defined types Change-Id: I102ce7e97280e7b80f8270ab3b7bbdc111d4d68c Reviewed-on: https://gerrit.libreoffice.org/78168 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sal/qa/rtl/strings/test_ostring_concat.cxx b/sal/qa/rtl/strings/test_ostring_concat.cxx index 4f4f2e3f799b..15795d039cee 100644 --- a/sal/qa/rtl/strings/test_ostring_concat.cxx +++ b/sal/qa/rtl/strings/test_ostring_concat.cxx @@ -11,6 +11,7 @@ #define RTL_STRING_UNITTEST_CONCAT #include <sal/types.h> +#include <cppunit/TestAssert.h> #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> @@ -19,20 +20,21 @@ #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> +#include <string> #include <typeinfo> bool rtl_string_unittest_invalid_concat = false; using namespace rtl; -namespace std +namespace CppUnit { -template< typename charT, typename traits > static std::basic_ostream<charT, traits> & -operator <<( - std::basic_ostream<charT, traits> & stream, const std::type_info& info ) +template<> struct assertion_traits<std::type_info> { - return stream << info.name(); -} + static bool equal(std::type_info const & x, std::type_info const & y) { return x == y; } + + static std::string toString(std::type_info const & x) { return x.name(); } +}; } // namespace namespace test { namespace ostring { diff --git a/sal/qa/rtl/strings/test_oustring_concat.cxx b/sal/qa/rtl/strings/test_oustring_concat.cxx index 874666869554..8ec1699d4431 100644 --- a/sal/qa/rtl/strings/test_oustring_concat.cxx +++ b/sal/qa/rtl/strings/test_oustring_concat.cxx @@ -12,6 +12,7 @@ extern bool rtl_string_unittest_invalid_concat; #include <sal/types.h> +#include <cppunit/TestAssert.h> #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> @@ -20,18 +21,19 @@ extern bool rtl_string_unittest_invalid_concat; #include <rtl/string.hxx> #include <rtl/strbuf.hxx> +#include <string> #include <typeinfo> using namespace rtl; -namespace std +namespace CppUnit { -template< typename charT, typename traits > static std::basic_ostream<charT, traits> & -operator <<( - std::basic_ostream<charT, traits> & stream, const std::type_info& info ) +template<> struct assertion_traits<std::type_info> { - return stream << info.name(); -} + static bool equal(std::type_info const & x, std::type_info const & y) { return x == y; } + + static std::string toString(std::type_info const & x) { return x.name(); } +}; } // namespace namespace test { namespace oustring { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits