summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-01-17 11:07:29 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-01-17 11:07:29 +0100
commit7e69e6485f9e961e9a4862d8252491104018975a (patch)
tree80b2882f818cd01adead7c02e17507ebb7b459d4 /svl
parente75308f9099e3baebe7b283241e8b2fd799ef9ff (diff)
Adapted svl test_URIHelper to gbuild.
Diffstat (limited to 'svl')
-rw-r--r--svl/CppunitTest_svl_urihelper.mk63
-rw-r--r--svl/Module_svl.mk1
-rw-r--r--svl/qa/export.map34
-rw-r--r--svl/qa/unit/test_URIHelper.cxx (renamed from svl/qa/test_URIHelper.cxx)34
4 files changed, 78 insertions, 54 deletions
diff --git a/svl/CppunitTest_svl_urihelper.mk b/svl/CppunitTest_svl_urihelper.mk
new file mode 100644
index 000000000000..8f5f3adb4d2b
--- /dev/null
+++ b/svl/CppunitTest_svl_urihelper.mk
@@ -0,0 +1,63 @@
+##
+## Version: MPL 1.1 / GPLv3+ / LGPLv3+
+##
+## The contents of this file are subject to the Mozilla Public License Version
+## 1.1 (the "License"); you may not use this file except in compliance with
+## the License or as specified alternatively below. You may obtain a copy of
+## the License at http://www.mozilla.org/MPL/
+##
+## Software distributed under the License is distributed on an "AS IS" basis,
+## WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+## for the specific language governing rights and limitations under the
+## License.
+##
+## Major Contributor(s):
+## [ Copyright (C) 2012 Red Hat, Inc., Stephan Bergmann <sbergman@redhat.com>
+## (initial developer) ]
+##
+## All Rights Reserved.
+##
+## For minor contributions see the git repository.
+##
+## Alternatively, the contents of this file may be used under the terms of
+## either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+## the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+## in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+## instead of those above.
+##
+
+$(eval $(call gb_CppunitTest_CppunitTest,svl_urihelper))
+
+$(eval $(call gb_CppunitTest_add_api,svl_urihelper, \
+ offapi \
+ udkapi \
+))
+
+$(eval $(call gb_CppunitTest_add_components,svl_urihelper, \
+ ucb/source/core/ucb1 \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,svl_urihelper, \
+svl/qa/unit/test_URIHelper \
+))
+
+$(eval $(call gb_CppunitTest_add_linked_libs,svl_urihelper, \
+ cppu \
+ cppuhelper \
+ sal \
+ svl \
+ tl \
+ utl \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_CppunitTest_add_type_rdbs,svl_urihelper, \
+ types \
+))
+
+$(eval $(call gb_CppunitTest_set_args,svl_urihelper, \
+ --protector unoexceptionprotector$(gb_Library_DLLEXT) \
+ unoexceptionprotector \
+))
+
+$(eval $(call gb_CppunitTest_uses_ure,svl_urihelper))
diff --git a/svl/Module_svl.mk b/svl/Module_svl.mk
index 6367ee73956d..26ce7e0c460c 100644
--- a/svl/Module_svl.mk
+++ b/svl/Module_svl.mk
@@ -38,6 +38,7 @@ $(eval $(call gb_Module_add_targets,svl,\
$(eval $(call gb_Module_add_check_targets,svl,\
CppunitTest_svl_lngmisc \
+ CppunitTest_svl_urihelper \
))
$(eval $(call gb_Module_add_subsequentcheck_targets,svl,\
diff --git a/svl/qa/export.map b/svl/qa/export.map
deleted file mode 100644
index 3308588ef6f8..000000000000
--- a/svl/qa/export.map
+++ /dev/null
@@ -1,34 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-UDK_3_0_0 {
- global:
- cppunitTestPlugIn;
-
- local:
- *;
-};
diff --git a/svl/qa/test_URIHelper.cxx b/svl/qa/unit/test_URIHelper.cxx
index fe98d7104a83..d7cc5ab9b768 100644
--- a/svl/qa/test_URIHelper.cxx
+++ b/svl/qa/unit/test_URIHelper.cxx
@@ -29,12 +29,7 @@
#include "sal/config.h"
#include "sal/precppunit.hxx"
-#include <cppunit/TestSuite.h>
-#include <cppunit/TestFixture.h>
-#include <cppunit/TestCase.h>
-#include <cppunit/plugin/TestPlugIn.h>
-#include <cppunit/extensions/HelperMacros.h>
-
+#include <cassert>
#include <cstddef>
#include "com/sun/star/lang/Locale.hpp"
@@ -59,24 +54,23 @@
#include "cppuhelper/bootstrap.hxx"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/implbase2.hxx"
-#include "osl/diagnose.h"
+#include "cppunit/TestCase.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/TestSuite.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
#include "rtl/strbuf.hxx"
#include "rtl/string.h"
#include "rtl/string.hxx"
#include "rtl/textenc.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
+#include "sal/macros.h"
#include "sal/types.h"
-#include <sal/macros.h>
+#include "svl/urihelper.hxx"
#include "tools/solar.h"
#include "unotools/charclass.hxx"
-#include "urihelper.hxx"
-
-// This test needs a UNO component context that supports various services (the
-// UCB, an UriReferenceFactory, ...), so it is best executed within an OOo
-// installation.
-
namespace com { namespace sun { namespace star { namespace ucb {
class XCommandEnvironment;
class XContentEventListener;
@@ -144,7 +138,7 @@ Content::Content(
css::uno::Reference< css::ucb::XContentIdentifier > const & identifier):
m_identifier(identifier)
{
- OSL_ASSERT(m_identifier.is());
+ assert(m_identifier.is());
rtl::OUString uri(m_identifier->getContentIdentifier());
if (!uri.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(m_prefix))
|| uri.indexOf('#', RTL_CONSTASCII_LENGTH(m_prefix)) != -1)
@@ -207,7 +201,7 @@ public:
css::uno::Reference< css::ucb::XContentIdentifier > const & id2)
throw (css::uno::RuntimeException)
{
- OSL_ASSERT(id1.is() && id2.is());
+ assert(id1.is() && id2.is());
return
id1->getContentIdentifier().compareTo(id2->getContentIdentifier());
}
@@ -263,12 +257,12 @@ void Test::testNormalizedMakeRelative() {
css::uno::UNO_QUERY_THROW)->registerContentProvider(
new Provider, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("test")),
true);
- struct Test {
+ struct Data {
char const * base;
char const * absolute;
char const * relative;
};
- static Test const tests[] = {
+ static Data const tests[] = {
{ "hierarchical:/", "mailto:def@a.b.c.", "mailto:def@a.b.c." },
{ "hierarchical:/", "a/b/c", "a/b/c" },
{ "hierarchical:/a", "hierarchical:/a/b/c?d#e", "/a/b/c?d#e" },
@@ -329,13 +323,13 @@ void Test::testNormalizedMakeRelative() {
}
void Test::testFindFirstURLInText() {
- struct Test {
+ struct Data {
char const * input;
char const * result;
xub_StrLen begin;
xub_StrLen end;
};
- static Test const tests[] = {
+ static Data const tests[] = {
{ "...ftp://bla.bla.bla/blubber/...",
"ftp://bla.bla.bla/blubber/", 3, 29 },
{ "..\\ftp://bla.bla.bla/blubber/...", 0, 0, 0 },