summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-09-30 12:39:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-09-30 12:39:35 +0100
commit4a5745503c2bf5d66f83995d90fd51e07b0b0e70 (patch)
tree77aeeb890888d67d7f89b0c5dd626213a7d1a4c3 /test
parentebbfc7ea4aea33f79edbb6c989d598f5cbda3854 (diff)
merge filters-test code
Diffstat (limited to 'test')
-rw-r--r--test/inc/test/bootstrapfixture.hxx4
-rw-r--r--test/prj/d.lst1
-rw-r--r--test/source/bootstrapfixture.cxx29
-rw-r--r--test/source/makefile.mk3
4 files changed, 22 insertions, 15 deletions
diff --git a/test/inc/test/bootstrapfixture.hxx b/test/inc/test/bootstrapfixture.hxx
index 7a0cc90220f5..53bb39dde0e3 100644
--- a/test/inc/test/bootstrapfixture.hxx
+++ b/test/inc/test/bootstrapfixture.hxx
@@ -53,12 +53,14 @@ class OOO_DLLPUBLIC_TEST BootstrapFixture : public CppUnit::TestFixture
::rtl::OUString m_aSrcRootURL;
::rtl::OUString m_aSrcRootPath;
+protected:
+
com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> m_xContext;
com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> m_xSFactory;
com::sun::star::uno::Reference<com::sun::star::lang::XMultiComponentFactory> m_xFactory;
public:
- BootstrapFixture( bool bAssertOnDialog = true );
+ BootstrapFixture( bool bAssertOnDialog = true, bool bNeedUCB = true );
virtual ~BootstrapFixture();
com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
diff --git a/test/prj/d.lst b/test/prj/d.lst
index 9211e33b9131..84491d1f2198 100644
--- a/test/prj/d.lst
+++ b/test/prj/d.lst
@@ -6,3 +6,4 @@ mkdir: %_DEST%\inc\test
..\%__SRC%\lib\libtest.dll.a %_DEST%\lib\libtest.dll.a
..\inc\test\testdllapi.hxx %_DEST%\inc\test\testdllapi.hxx
..\inc\test\bootstrapfixture.hxx %_DEST%\inc\test\bootstrapfixture.hxx
+..\inc\test\filters-test.hxx %_DEST%\inc\test\filters-test.hxx
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index 0d0234e0346e..557b42d0c38d 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -54,7 +54,7 @@ static void aBasicErrorFunc( const String &rErr, const String &rAction )
CPPUNIT_ASSERT_MESSAGE( aErr.getStr(), false);
}
-test::BootstrapFixture::BootstrapFixture( bool bAssertOnDialog )
+test::BootstrapFixture::BootstrapFixture( bool bAssertOnDialog, bool bNeedUCB )
: m_aSrcRootURL(RTL_CONSTASCII_USTRINGPARAM("file://"))
{
const char* pSrcRoot = getenv( "SRC_ROOT" );
@@ -81,18 +81,21 @@ test::BootstrapFixture::BootstrapFixture( bool bAssertOnDialog )
//of retaining references to the root ServiceFactory as its passed around
comphelper::setProcessServiceFactory(m_xSFactory);
- // initialise UCB-Broker
- uno::Sequence<uno::Any> aUcbInitSequence(2);
- aUcbInitSequence[0] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Local"));
- aUcbInitSequence[1] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office"));
- bool bInitUcb = ucbhelper::ContentBroker::initialize(m_xSFactory, aUcbInitSequence);
- CPPUNIT_ASSERT_MESSAGE("Should be able to initialize UCB", bInitUcb);
-
- uno::Reference<ucb::XContentProviderManager> xUcb =
- ucbhelper::ContentBroker::get()->getContentProviderManagerInterface();
- uno::Reference<ucb::XContentProvider> xFileProvider(m_xSFactory->createInstance(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.FileContentProvider"))), uno::UNO_QUERY);
- xUcb->registerContentProvider(xFileProvider, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file")), sal_True);
+ if (bNeedUCB)
+ {
+ // initialise UCB-Broker
+ uno::Sequence<uno::Any> aUcbInitSequence(2);
+ aUcbInitSequence[0] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Local"));
+ aUcbInitSequence[1] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office"));
+ bool bInitUcb = ucbhelper::ContentBroker::initialize(m_xSFactory, aUcbInitSequence);
+ CPPUNIT_ASSERT_MESSAGE("Should be able to initialize UCB", bInitUcb);
+
+ uno::Reference<ucb::XContentProviderManager> xUcb =
+ ucbhelper::ContentBroker::get()->getContentProviderManagerInterface();
+ uno::Reference<ucb::XContentProvider> xFileProvider(m_xSFactory->createInstance(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.FileContentProvider"))), uno::UNO_QUERY);
+ xUcb->registerContentProvider(xFileProvider, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file")), sal_True);
+ }
// force locale (and resource files loaded) to en-US
const LanguageType eLang=LANGUAGE_ENGLISH_US;
diff --git a/test/source/makefile.mk b/test/source/makefile.mk
index 63109a819019..6f68b71ae24d 100644
--- a/test/source/makefile.mk
+++ b/test/source/makefile.mk
@@ -38,7 +38,8 @@ CDEFS += -DOOO_DLLIMPLEMENTATION_TEST
CFLAGSCXX += $(CPPUNIT_CFLAGS)
SLOFILES = \
- $(SLO)/bootstrapfixture.obj
+ $(SLO)/bootstrapfixture.obj \
+ $(SLO)/filters-test.obj
.IF "$(CROSS_COMPILING)" == "YES"
SHL1IMPLIB = $(SHL1TARGET)