summaryrefslogtreecommitdiff
path: root/smoketestoo_native/smoketest.cxx
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-02-03 13:33:46 +0100
committersb <sb@openoffice.org>2010-02-03 13:33:46 +0100
commit04d1a5812d3e8292714f69cffee7b68031c8dae2 (patch)
treeb0b869337e6e3ccc433831c36d92ac1a405b6c9d /smoketestoo_native/smoketest.cxx
parentbdd7a0f37c4f280e27289079129b8136d0befef2 (diff)
sb118: simplified from CppUnit::assertion_traits<rtl::OUString> to just std::basic_ostream::operator<< specialization
Diffstat (limited to 'smoketestoo_native/smoketest.cxx')
-rw-r--r--smoketestoo_native/smoketest.cxx28
1 files changed, 12 insertions, 16 deletions
diff --git a/smoketestoo_native/smoketest.cxx b/smoketestoo_native/smoketest.cxx
index e9a3227ae34f..f7c2c8d30040 100644
--- a/smoketestoo_native/smoketest.cxx
+++ b/smoketestoo_native/smoketest.cxx
@@ -29,7 +29,7 @@
#include "sal/config.h"
-#include "string"
+#include <ostream>
#include "boost/noncopyable.hpp"
#include "com/sun/star/beans/PropertyState.hpp"
@@ -65,33 +65,29 @@
#include "osl/diagnose.h"
#include "osl/file.hxx"
#include "osl/process.h"
+#include "osl/thread.h"
#include "osl/time.h"
#include "rtl/bootstrap.hxx"
#include "rtl/string.hxx"
-#include "rtl/textenc.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/main.h"
#include "sal/types.h"
-namespace CppUnit {
-
-template<> struct assertion_traits< rtl::OUString > {
- static bool equal(rtl::OUString const & x, rtl::OUString const & y) {
- return x == y;
- }
-
- static std::string toString(rtl::OUString const & x) {
- return rtl::OUStringToOString(x, RTL_TEXTENCODING_UTF8).getStr();
- }
-};
-
-}
-
namespace {
namespace css = com::sun::star;
+template< typename charT, typename traits > std::basic_ostream<charT, traits> &
+operator <<(
+ std::basic_ostream<charT, traits> & stream, rtl::OUString const & string)
+{
+ return stream <<
+ rtl::OUStringToOString(string, osl_getThreadTextEncoding()).getStr();
+ // best effort; potentially loses data due to conversion failures and
+ // embedded null characters
+}
+
rtl::OUString argumentName(rtl::OUString const & name) {
return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("arg-")) + name;
}