summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-08-27 09:06:31 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-08-27 15:16:29 +0200
commitad4c7b97752b4da73808402604d6f96b39d920f5 (patch)
treef952695968b32628cba239ef1ab3f034645618f2 /sal
parentcd4808e2e77fe08d260ecc22177dd7e23a7c5319 (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/strings/test_ostring_concat.cxx14
-rw-r--r--sal/qa/rtl/strings/test_oustring_concat.cxx14
2 files changed, 16 insertions, 12 deletions
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 {