summaryrefslogtreecommitdiff
path: root/svl/qa/test_URIHelper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svl/qa/test_URIHelper.cxx')
-rw-r--r--svl/qa/test_URIHelper.cxx25
1 files changed, 20 insertions, 5 deletions
diff --git a/svl/qa/test_URIHelper.cxx b/svl/qa/test_URIHelper.cxx
index cdf6b1780884..c206def13830 100644
--- a/svl/qa/test_URIHelper.cxx
+++ b/svl/qa/test_URIHelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,12 @@
#include "sal/config.h"
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/TestCase.h>
+#include <cppunit/plugin/TestPlugIn.h>
+#include <cppunit/extensions/HelperMacros.h>
+
#include <cstddef>
#include "com/sun/star/lang/Locale.hpp"
@@ -54,7 +61,6 @@
#include "cppuhelper/bootstrap.hxx"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/implbase2.hxx"
-#include "testshl/simpleheader.hxx"
#include "osl/diagnose.h"
#include "rtl/strbuf.hxx"
#include "rtl/string.h"
@@ -63,6 +69,7 @@
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
+#include <sal/macros.h>
#include "tools/solar.h"
#include "unotools/charclass.hxx"
@@ -284,7 +291,7 @@ void Test::testNormalizedMakeRelative() {
"nonex3/nonex4" }
#endif
};
- for (std::size_t i = 0; i < sizeof tests / sizeof tests[0]; ++i) {
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i) {
css::uno::Reference< css::uri::XUriReference > ref(
URIHelper::normalizedMakeRelative(
m_context, rtl::OUString::createFromAscii(tests[i].base),
@@ -335,7 +342,13 @@ void Test::testFindFirstURLInText() {
"ftp://bla.bla.bla/blubber/", 3, 29 },
{ "..\\ftp://bla.bla.bla/blubber/...", 0, 0, 0 },
{ "..\\ftp:\\\\bla.bla.bla\\blubber/...",
+//Sync with tools/source/fsys/urlobj.cxx and changeScheme
+#ifdef LINUX
+ "smb://bla.bla.bla/blubber%2F", 7, 29 },
+#endif
+#ifdef WNT
"file://bla.bla.bla/blubber%2F", 7, 29 },
+#endif
{ "http://sun.com", "http://sun.com/", 0, 14 },
{ "http://sun.com/", "http://sun.com/", 0, 15 },
{ "http://www.xerox.com@www.pcworld.com/go/3990332.htm", 0, 0, 0 },
@@ -414,7 +427,7 @@ void Test::testFindFirstURLInText() {
com::sun::star::lang::Locale(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US")), rtl::OUString()));
- for (std::size_t i = 0; i < sizeof tests / sizeof tests[0]; ++i) {
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i) {
rtl::OUString input(rtl::OUString::createFromAscii(tests[i].input));
xub_StrLen begin = 0;
xub_StrLen end = static_cast< xub_StrLen >(input.getLength());
@@ -452,8 +465,10 @@ void Test::testFindFirstURLInText() {
css::uno::Reference< css::uno::XComponentContext > Test::m_context;
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests");
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
-NOADDITIONAL;
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */