[Libreoffice-commits] .: 5 commits - comphelper/inc sc/CppunitTest_sc_test_filters.mk sc/qa sw/CppunitTest_sw_swdoc_test.mk sw/CppunitTest_sw_test_filters.mk sw/qa test/inc test/prj test/source unotools/inc
Michael Meeks
michael at kemper.freedesktop.org
Wed Sep 28 07:09:08 PDT 2011
comphelper/inc/comphelper/processfactory.hxx | 4
sc/CppunitTest_sc_test_filters.mk | 1
sc/qa/unit/filters-test.cxx | 140 +++++----------------------
sc/qa/unit/helper/csv_handler.hxx | 9 +
sw/CppunitTest_sw_swdoc_test.mk | 1
sw/CppunitTest_sw_test_filters.mk | 1
sw/qa/core/filters-test.cxx | 109 ++++-----------------
sw/qa/core/swdoc-test.cxx | 50 ---------
test/inc/test/bootstrapfixture.hxx | 80 +++++++++++++++
test/prj/build.lst | 2
test/prj/d.lst | 1
test/source/cpp/bootstrapfixture.cxx | 115 ++++++++++++++++++++++
test/source/cpp/makefile.mk | 6 +
unotools/inc/unotools/syslocaleoptions.hxx | 1
14 files changed, 265 insertions(+), 255 deletions(-)
New commits:
commit 37fd0d9884b41491bc14d9b4e00ad1f9a00dd712
Author: Michael Meeks <michael.meeks at suse.com>
Date: Wed Sep 28 15:09:00 2011 +0100
sw: switch filters-test to the new shared unit test code
diff --git a/sw/CppunitTest_sw_swdoc_test.mk b/sw/CppunitTest_sw_swdoc_test.mk
index 0c9c1bc..d1ea1d3 100644
--- a/sw/CppunitTest_sw_swdoc_test.mk
+++ b/sw/CppunitTest_sw_swdoc_test.mk
@@ -58,6 +58,7 @@ $(eval $(call gb_CppunitTest_add_linked_libs,sw_swdoc_test, \
svx \
svxcore \
swd \
+ test \
tk \
tl \
ucbhelper \
diff --git a/sw/CppunitTest_sw_test_filters.mk b/sw/CppunitTest_sw_test_filters.mk
index ba5f1a4..6541bf7 100644
--- a/sw/CppunitTest_sw_test_filters.mk
+++ b/sw/CppunitTest_sw_test_filters.mk
@@ -43,6 +43,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sw_filters_test, \
$(call gb_CxxObject_get_target,sw/qa/core/filters-test): $(WORKDIR)/AllLangRes/sw
$(eval $(call gb_CppunitTest_add_linked_libs,sw_filters_test, \
+ test \
sw \
sfx \
svl \
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index 9084c1e..6bd2ba8 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -27,34 +27,14 @@
* instead of those above.
*/
-#include "sal/config.h"
-#include "sal/precppunit.hxx"
-
-#include "cppunit/TestAssert.h"
-#include "cppunit/TestFixture.h"
-#include "cppunit/extensions/HelperMacros.h"
-#include "cppunit/plugin/TestPlugIn.h"
+#include <sal/config.h>
+#include <test/bootstrapfixture.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
-#include <cppuhelper/compbase1.hxx>
-#include <cppuhelper/bootstrap.hxx>
-#include <cppuhelper/basemutex.hxx>
-
-#include <comphelper/processfactory.hxx>
-
-#include <i18npool/mslangid.hxx>
-
#include <tools/urlobj.hxx>
-#include <unotools/tempfile.hxx>
-#include <unotools/syslocaleoptions.hxx>
-
-#include <vcl/svapp.hxx>
-
-#include <ucbhelper/contentbroker.hxx>
-
#include <sfx2/app.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
@@ -76,11 +56,10 @@ using namespace ::com::sun::star;
/* Implementation of Filters test */
-class FiltersTest : public CppUnit::TestFixture
+class FiltersTest : public test::BootstrapFixture
{
public:
FiltersTest();
- ~FiltersTest();
virtual void setUp();
virtual void tearDown();
@@ -88,9 +67,7 @@ public:
void recursiveScan(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData, int nExpected);
bool load(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData);
- /**
- * Ensure CVEs remain unbroken
- */
+ // Ensure CVEs remain unbroken
void testCVEs();
CPPUNIT_TEST_SUITE(FiltersTest);
@@ -98,8 +75,6 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- uno::Reference<uno::XComponentContext> m_xContext;
- uno::Reference<lang::XMultiComponentFactory> m_xFactory;
uno::Reference<uno::XInterface> m_xWriterComponent;
::rtl::OUString m_aSrcRoot;
int m_nLoadedDocs;
@@ -172,86 +147,44 @@ void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUStrin
void FiltersTest::testCVEs()
{
- recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Staroffice XML (Writer)")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/sw/qa/core/data/xml/pass")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CXML")), true);
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Staroffice XML (Writer)")),
+ getURLFromSrc("/sw/qa/core/data/xml/pass"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CXML")), true);
- recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Staroffice XML (Writer)")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/sw/qa/core/data/xml/fail")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CXML")), false);
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Staroffice XML (Writer)")),
+ getURLFromSrc("/sw/qa/core/data/xml/fail"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CXML")), false);
- recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/sw/qa/core/data/ww8/pass")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")), true);
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")),
+ getURLFromSrc("/sw/qa/core/data/ww8/pass"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")), true);
- recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/sw/qa/core/data/ww8/fail")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")), false);
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")),
+ getURLFromSrc("/sw/qa/core/data/ww8/fail"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")), false);
- recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/sw/qa/core/data/ww8/indeterminate")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")), indeterminate);
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")),
+ getURLFromSrc("/sw/qa/core/data/ww8/indeterminate"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")), indeterminate);
printf("Writer: tested %d files\n", m_nLoadedDocs);
}
FiltersTest::FiltersTest()
- : m_aSrcRoot(RTL_CONSTASCII_USTRINGPARAM("file://"))
- , m_nLoadedDocs(0)
+ : m_nLoadedDocs(0)
{
- m_xContext = cppu::defaultBootstrap_InitialComponentContext();
- m_xFactory = m_xContext->getServiceManager();
-
- uno::Reference<lang::XMultiServiceFactory> xSM(m_xFactory, uno::UNO_QUERY_THROW);
-
- //Without this we're crashing because callees are using
- //getProcessServiceFactory. In general those should be removed in favour
- //of retaining references to the root ServiceFactory as its passed around
- comphelper::setProcessServiceFactory(xSM);
-
- // 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(xSM, 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(xSM->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;
-
- rtl::OUString aLang, aCountry;
- MsLangId::convertLanguageToIsoNames(eLang, aLang, aCountry);
- lang::Locale aLocale(aLang, aCountry, rtl::OUString());
- ResMgr::SetDefaultLocale( aLocale );
-
- SvtSysLocaleOptions aLocalOptions;
- aLocalOptions.SetUILocaleConfigString(
- MsLangId::convertLanguageToIsoString( eLang ) );
-
- InitVCL(xSM);
-
//This is a bit of a fudge, we do this to ensure that SwGlobals::ensure,
//which is a private symbol to us, gets called
m_xWriterComponent =
- xSM->createInstance(rtl::OUString(
+ getMultiServiceFactory()->createInstance(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.TextDocument")));
CPPUNIT_ASSERT_MESSAGE("no writer component!", m_xWriterComponent.is());
-
- const char* pSrcRoot = getenv( "SRC_ROOT" );
- CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot != NULL && pSrcRoot[0] != 0);
-
-#ifdef WNT
- if (pSrcRoot[1] == ':')
- m_aSrcRoot += rtl::OUString::createFromAscii( "/" );
-#endif
- m_aSrcRoot += rtl::OUString::createFromAscii( pSrcRoot );
}
void FiltersTest::setUp()
{
}
-FiltersTest::~FiltersTest()
-{
- uno::Reference< lang::XComponent >(m_xContext, uno::UNO_QUERY_THROW)->dispose();
-}
-
void FiltersTest::tearDown()
{
}
diff --git a/sw/qa/core/swdoc-test.cxx b/sw/qa/core/swdoc-test.cxx
index cb12030..e707cbd 100644
--- a/sw/qa/core/swdoc-test.cxx
+++ b/sw/qa/core/swdoc-test.cxx
@@ -28,31 +28,15 @@
* instead of those above.
*/
-#include "sal/config.h"
-#include "sal/precppunit.hxx"
-
-#include "cppunit/TestAssert.h"
-#include "cppunit/TestFixture.h"
-#include "cppunit/extensions/HelperMacros.h"
-#include "cppunit/plugin/TestPlugIn.h"
+#include <sal/config.h>
+#include <test/bootstrapfixture.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
-#include <cppuhelper/compbase1.hxx>
-#include <cppuhelper/bootstrap.hxx>
-#include <cppuhelper/basemutex.hxx>
-
-#include <comphelper/processfactory.hxx>
-
#include <tools/urlobj.hxx>
-
#include <unotools/tempfile.hxx>
-#include <ucbhelper/contentbroker.hxx>
-
-#include <vcl/svapp.hxx>
-
#include <sfx2/app.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
@@ -79,7 +63,7 @@ using namespace ::com::sun::star;
/* Implementation of Swdoc-Test class */
-class SwDocTest : public CppUnit::TestFixture
+class SwDocTest : public test::BootstrapFixture
{
public:
SwDocTest();
@@ -105,8 +89,6 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- uno::Reference<uno::XComponentContext> m_xContext;
- uno::Reference<lang::XMultiComponentFactory> m_xFactory;
SwDoc *m_pDoc;
SwDocShellRef m_xDocShRef;
};
@@ -462,32 +444,6 @@ void SwDocTest::randomTest()
SwDocTest::SwDocTest()
{
- m_xContext = cppu::defaultBootstrap_InitialComponentContext();
- m_xFactory = m_xContext->getServiceManager();
-
- uno::Reference<lang::XMultiServiceFactory> xSM(m_xFactory, uno::UNO_QUERY_THROW);
-
- //Without this we're crashing because callees are using
- //getProcessServiceFactory. In general those should be removed in favour
- //of retaining references to the root ServiceFactory as its passed around
- comphelper::setProcessServiceFactory(xSM);
-
- // 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(xSM, 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(xSM->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);
-
-
- InitVCL(xSM);
-
SwGlobals::ensure();
}
commit 4b7cc85c4ed02876a1e4851274129d0d89c398cc
Author: Michael Meeks <michael.meeks at suse.com>
Date: Wed Sep 28 15:00:05 2011 +0100
sc: switch filters-test to the new shared unit test code
diff --git a/sc/CppunitTest_sc_test_filters.mk b/sc/CppunitTest_sc_test_filters.mk
index 1b13294..ee9ac5f 100644
--- a/sc/CppunitTest_sc_test_filters.mk
+++ b/sc/CppunitTest_sc_test_filters.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sc_filters_test, \
))
$(eval $(call gb_CppunitTest_add_linked_libs,sc_filters_test, \
+ test \
avmedia \
basegfx \
comphelper \
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index f1ae199..45916ff 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -28,34 +28,14 @@
*/
#include <sal/config.h>
-#include "sal/precppunit.hxx"
-
-#include "cppunit/TestAssert.h"
-#include "cppunit/TestFixture.h"
-#include "cppunit/extensions/HelperMacros.h"
-#include "cppunit/plugin/TestPlugIn.h"
+#include <test/bootstrapfixture.hxx>
#include <rtl/strbuf.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
-#include <cppuhelper/compbase1.hxx>
-#include <cppuhelper/bootstrap.hxx>
-#include <cppuhelper/basemutex.hxx>
-
-#include <comphelper/processfactory.hxx>
-
-#include <i18npool/mslangid.hxx>
-
#include <tools/urlobj.hxx>
-#include <unotools/tempfile.hxx>
-#include <unotools/syslocaleoptions.hxx>
-
-#include <vcl/svapp.hxx>
-
-#include <ucbhelper/contentbroker.hxx>
-
#include <sfx2/app.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
@@ -64,13 +44,6 @@
#include <editeng/brshitem.hxx>
#include <editeng/justifyitem.hxx>
-#include "docsh.hxx"
-#include "document.hxx"
-#include "postit.hxx"
-#include "patattr.hxx"
-#include "scitems.hxx"
-#include "cellform.hxx"
-
#include "helper/csv_handler.hxx"
#include "orcus/csv_parser.hpp"
#include <fstream>
@@ -161,7 +134,7 @@ void testCondFile(rtl::OUString& aFileName, ScDocument* pDoc, SCTAB nTab)
/* Implementation of Filters test */
-class FiltersTest : public CppUnit::TestFixture
+class FiltersTest : public test::BootstrapFixture
{
public:
FiltersTest();
@@ -173,7 +146,7 @@ public:
void recursiveScan(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData, int nExpected);
ScDocShellRef load(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData, const rtl::OUString& rTypeName, sal_uLong nFormatType = 0);
- void createFilePath(const rtl::OUString& aFileBase, const rtl::OUString& aFileExtension, rtl::OUString& rFilePath);
+ void createFileURL(const rtl::OUString& aFileBase, const rtl::OUString& aFileExtension, rtl::OUString& rFilePath);
void createCSVPath(const rtl::OUString& aFileBase, rtl::OUString& rFilePath);
/**
@@ -204,11 +177,7 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- uno::Reference<uno::XComponentContext> m_xContext;
- uno::Reference<lang::XMultiComponentFactory> m_xFactory;
uno::Reference<uno::XInterface> m_xCalcComponent;
- ::rtl::OUString m_aSrcRoot;
- ::rtl::OUString m_aFileRoot; //m_aSrcRoot without "file://" prefix
::rtl::OUString m_aBaseString;
};
@@ -283,10 +252,10 @@ void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUStrin
CPPUNIT_ASSERT(osl::FileBase::E_None == aDir.close());
}
-void FiltersTest::createFilePath(const rtl::OUString& aFileBase, const rtl::OUString& aFileExtension, rtl::OUString& rFilePath)
+void FiltersTest::createFileURL(const rtl::OUString& aFileBase, const rtl::OUString& aFileExtension, rtl::OUString& rFilePath)
{
rtl::OUString aSep(RTL_CONSTASCII_USTRINGPARAM("/"));
- rtl::OUStringBuffer aBuffer(m_aSrcRoot);
+ rtl::OUStringBuffer aBuffer( getSrcRootURL() );
aBuffer.append(m_aBaseString).append(aSep).append(aFileExtension);
aBuffer.append(aSep).append(aFileBase).append(aFileExtension);
rFilePath = aBuffer.makeStringAndClear();
@@ -294,7 +263,7 @@ void FiltersTest::createFilePath(const rtl::OUString& aFileBase, const rtl::OUSt
void FiltersTest::createCSVPath(const rtl::OUString& aFileBase, rtl::OUString& rCSVPath)
{
- rtl::OUStringBuffer aBuffer(m_aFileRoot);
+ rtl::OUStringBuffer aBuffer(getSrcRootPath());
aBuffer.append(m_aBaseString).append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/contentCSV/")));
aBuffer.append(aFileBase).append(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("csv")));
rCSVPath = aBuffer.makeStringAndClear();
@@ -303,26 +272,27 @@ void FiltersTest::createCSVPath(const rtl::OUString& aFileBase, rtl::OUString& r
void FiltersTest::testCVEs()
{
recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Quattro Pro 6.0")),
- m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data/qpro/pass")), rtl::OUString(), true);
+ getURLFromSrc("/sc/qa/unit/data/qpro/pass"), rtl::OUString(), true);
recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Quattro Pro 6.0")),
- m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data/qpro/fail")), rtl::OUString(), false);
+ getURLFromSrc("/sc/qa/unit/data/qpro/fail"), rtl::OUString(), false);
recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Quattro Pro 6.0")),
- m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data/qpro/indeterminate")), rtl::OUString(), indeterminate);
+ getURLFromSrc("/sc/qa/unit/data/qpro/indeterminate"),
+ rtl::OUString(), indeterminate);
//warning, the current "sylk filter" in sc (docsh.cxx) automatically
//chains on failure on trying as csv, rtf, etc. so "success" may
//not indicate that it imported as .slk.
recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SYLK")),
- m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data/slk/pass")), rtl::OUString(), true);
+ getURLFromSrc("/sc/qa/unit/data/slk/pass"), rtl::OUString(), true);
recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SYLK")),
- m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data/slk/fail")), rtl::OUString(), false);
+ getURLFromSrc("/sc/qa/unit/data/slk/fail"), rtl::OUString(), false);
recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SYLK")),
- m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data/slk/indeterminate")), rtl::OUString(), indeterminate);
-
+ getURLFromSrc("/sc/qa/unit/data/slk/indeterminate"),
+ rtl::OUString(), indeterminate);
}
namespace {
@@ -366,7 +336,7 @@ void FiltersTest::testRangeName()
rtl::OUString aFileExtension(aFileFormats[i].pName, strlen(aFileFormats[i].pName), RTL_TEXTENCODING_UTF8 );
rtl::OUString aFilterName(aFileFormats[i].pFilterName, strlen(aFileFormats[i].pFilterName), RTL_TEXTENCODING_UTF8) ;
rtl::OUString aFileName;
- createFilePath( aFileNameBase, aFileExtension, aFileName );
+ createFileURL( aFileNameBase, aFileExtension, aFileName );
rtl::OUString aFilterType(aFileFormats[i].pTypeName, strlen(aFileFormats[i].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << aFileFormats[i].pName << " Test" << std::endl;
ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[i].nFormatType);
@@ -426,7 +396,7 @@ void FiltersTest::testContent()
rtl::OUString aFileExtension(aFileFormats[i].pName, strlen(aFileFormats[i].pName), RTL_TEXTENCODING_UTF8 );
rtl::OUString aFilterName(aFileFormats[i].pFilterName, strlen(aFileFormats[i].pFilterName), RTL_TEXTENCODING_UTF8) ;
rtl::OUString aFileName;
- createFilePath(aFileNameBase, aFileExtension, aFileName);
+ createFileURL(aFileNameBase, aFileExtension, aFileName);
rtl::OUString aFilterType(aFileFormats[i].pTypeName, strlen(aFileFormats[i].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << aFileFormats[i].pName << " Test" << std::endl;
ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[i].nFormatType);
@@ -444,7 +414,7 @@ void FiltersTest::testFunctions()
rtl::OUString aFileExtension(aFileFormats[0].pName, strlen(aFileFormats[0].pName), RTL_TEXTENCODING_UTF8 );
rtl::OUString aFilterName(aFileFormats[0].pFilterName, strlen(aFileFormats[0].pFilterName), RTL_TEXTENCODING_UTF8) ;
rtl::OUString aFileName;
- createFilePath(aFileNameBase, aFileExtension, aFileName);
+ createFileURL(aFileNameBase, aFileExtension, aFileName);
rtl::OUString aFilterType(aFileFormats[0].pTypeName, strlen(aFileFormats[0].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << aFileFormats[0].pName << " Test" << std::endl;
ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[0].nFormatType);
@@ -463,7 +433,7 @@ void FiltersTest::testDatabaseRanges()
rtl::OUString aFileExtension(aFileFormats[0].pName, strlen(aFileFormats[0].pName), RTL_TEXTENCODING_UTF8 );
rtl::OUString aFilterName(aFileFormats[0].pFilterName, strlen(aFileFormats[0].pFilterName), RTL_TEXTENCODING_UTF8) ;
rtl::OUString aFileName;
- createFilePath(aFileNameBase, aFileExtension, aFileName);
+ createFileURL(aFileNameBase, aFileExtension, aFileName);
rtl::OUString aFilterType(aFileFormats[0].pTypeName, strlen(aFileFormats[0].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << aFileFormats[0].pName << " Test" << std::endl;
ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[0].nFormatType);
@@ -508,7 +478,7 @@ void FiltersTest::testFormats()
rtl::OUString aFileExtension(aFileFormats[i].pName, strlen(aFileFormats[i].pName), RTL_TEXTENCODING_UTF8 );
rtl::OUString aFilterName(aFileFormats[i].pFilterName, strlen(aFileFormats[i].pFilterName), RTL_TEXTENCODING_UTF8) ;
rtl::OUString aFileName;
- createFilePath(aFileNameBase, aFileExtension, aFileName);
+ createFileURL(aFileNameBase, aFileExtension, aFileName);
rtl::OUString aFilterType(aFileFormats[i].pTypeName, strlen(aFileFormats[i].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << aFileFormats[i].pName << " Test" << std::endl;
ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[i].nFormatType);
@@ -588,7 +558,7 @@ void FiltersTest::testBugFixesODS()
rtl::OUString aFileExtension(aFileFormats[0].pName, strlen(aFileFormats[0].pName), RTL_TEXTENCODING_UTF8 );
rtl::OUString aFilterName(aFileFormats[0].pFilterName, strlen(aFileFormats[0].pFilterName), RTL_TEXTENCODING_UTF8) ;
rtl::OUString aFileName;
- createFilePath(aFileNameBase, aFileExtension, aFileName);
+ createFileURL(aFileNameBase, aFileExtension, aFileName);
rtl::OUString aFilterType(aFileFormats[0].pTypeName, strlen(aFileFormats[0].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << aFileFormats[0].pName << " Test" << std::endl;
ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[0].nFormatType);
@@ -604,7 +574,7 @@ void FiltersTest::testBugFixesXLS()
rtl::OUString aFileExtension(aFileFormats[1].pName, strlen(aFileFormats[1].pName), RTL_TEXTENCODING_UTF8 );
rtl::OUString aFilterName(aFileFormats[1].pFilterName, strlen(aFileFormats[1].pFilterName), RTL_TEXTENCODING_UTF8) ;
rtl::OUString aFileName;
- createFilePath(aFileNameBase, aFileExtension, aFileName);
+ createFileURL(aFileNameBase, aFileExtension, aFileName);
rtl::OUString aFilterType(aFileFormats[1].pTypeName, strlen(aFileFormats[1].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << aFileFormats[1].pName << " Test" << std::endl;
ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[1].nFormatType);
@@ -620,7 +590,7 @@ void FiltersTest::testBugFixesXLSX()
rtl::OUString aFileExtension(aFileFormats[2].pName, strlen(aFileFormats[2].pName), RTL_TEXTENCODING_UTF8 );
rtl::OUString aFilterName(aFileFormats[2].pFilterName, strlen(aFileFormats[2].pFilterName), RTL_TEXTENCODING_UTF8) ;
rtl::OUString aFileName;
- createFilePath(aFileNameBase, aFileExtension, aFileName);
+ createFileURL(aFileNameBase, aFileExtension, aFileName);
rtl::OUString aFilterType(aFileFormats[2].pTypeName, strlen(aFileFormats[2].pTypeName), RTL_TEXTENCODING_UTF8);
std::cout << aFileFormats[2].pName << " Test" << std::endl;
ScDocShellRef xDocSh = load (aFilterName, aFileName, rtl::OUString(), aFilterType, aFileFormats[2].nFormatType);
@@ -631,81 +601,23 @@ void FiltersTest::testBugFixesXLSX()
}
FiltersTest::FiltersTest()
- : m_aSrcRoot(RTL_CONSTASCII_USTRINGPARAM("file://")),
+ : test::BootstrapFixture(),
m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data"))
{
- m_xContext = cppu::defaultBootstrap_InitialComponentContext();
- m_xFactory = m_xContext->getServiceManager();
-
- uno::Reference<lang::XMultiServiceFactory> xSM(m_xFactory, uno::UNO_QUERY_THROW);
-
- //Without this we're crashing because callees are using
- //getProcessServiceFactory. In general those should be removed in favour
- //of retaining references to the root ServiceFactory as its passed around
- comphelper::setProcessServiceFactory(xSM);
-
- // 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(xSM, 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(xSM->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;
-
- rtl::OUString aLang, aCountry;
- MsLangId::convertLanguageToIsoNames(eLang, aLang, aCountry);
- lang::Locale aLocale(aLang, aCountry, rtl::OUString());
- ResMgr::SetDefaultLocale( aLocale );
-
- SvtSysLocaleOptions aLocalOptions;
- aLocalOptions.SetUILocaleConfigString(
- MsLangId::convertLanguageToIsoString( eLang ) );
-
- InitVCL(xSM);
-
- //This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
- //which is a private symbol to us, gets called
+ // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
+ // which is a private symbol to us, gets called
m_xCalcComponent =
- xSM->createInstance(rtl::OUString(
+ getMultiServiceFactory()->createInstance(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.SpreadsheetDocument")));
CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is());
-
- const char* pSrcRoot = getenv( "SRC_ROOT" );
- CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot != NULL && pSrcRoot[0] != 0);
-
-#ifdef WNT
- if (pSrcRoot[1] == ':')
- m_aSrcRoot += rtl::OUString::createFromAscii( "/" );
-#endif
- m_aFileRoot = rtl::OUString::createFromAscii( pSrcRoot );
- m_aSrcRoot += m_aFileRoot;
-}
-
-static void aBasicErrorFunc( const String &rErr, const String &rAction )
-{
- rtl::OStringBuffer aErr( "Unexpected dialog: " );
- aErr.append( rtl::OUStringToOString( rAction, RTL_TEXTENCODING_ASCII_US ) );
- aErr.append( " Error: " );
- aErr.append( rtl::OUStringToOString( rErr, RTL_TEXTENCODING_ASCII_US ) );
- CPPUNIT_ASSERT_MESSAGE( aErr.getStr(), false);
}
void FiltersTest::setUp()
{
- ErrorHandler::RegisterDisplay( aBasicErrorFunc );
}
FiltersTest::~FiltersTest()
{
- uno::Reference< lang::XComponent >(m_xContext, uno::UNO_QUERY_THROW)->dispose();
}
void FiltersTest::tearDown()
diff --git a/sc/qa/unit/helper/csv_handler.hxx b/sc/qa/unit/helper/csv_handler.hxx
index 83a8e99..417e930 100644
--- a/sc/qa/unit/helper/csv_handler.hxx
+++ b/sc/qa/unit/helper/csv_handler.hxx
@@ -27,8 +27,14 @@
#include <iostream>
-#define DEBUG_CSV_HANDLER 0
+#include "docsh.hxx"
+#include "postit.hxx"
+#include "patattr.hxx"
+#include "scitems.hxx"
+#include "document.hxx"
+#include "cellform.hxx"
+#define DEBUG_CSV_HANDLER 0
namespace {
@@ -47,7 +53,6 @@ rtl::OUString getConditionalFormatString(ScDocument* pDoc, SCCOL nCol, SCROW nRo
}
-
enum StringType { PureString, FormulaValue, StringValue };
class csv_handler
commit 00004ec8ca531698f72f7a1e99ef130ccfd5dd36
Author: Michael Meeks <michael.meeks at suse.com>
Date: Wed Sep 28 14:54:10 2011 +0100
add missing dependent include
diff --git a/unotools/inc/unotools/syslocaleoptions.hxx b/unotools/inc/unotools/syslocaleoptions.hxx
index 7d70ebd..becd4bc 100644
--- a/unotools/inc/unotools/syslocaleoptions.hxx
+++ b/unotools/inc/unotools/syslocaleoptions.hxx
@@ -37,6 +37,7 @@
#include <i18npool/lang.h>
#include <tools/string.hxx>
#include <unotools/options.hxx>
+#include <com/sun/star/lang/Locale.hpp>
// bits for broadcasting hints of changes in a SfxSimpleHint, may be combined
const sal_uLong SYSLOCALEOPTIONS_HINT_LOCALE = 0x00000001;
commit 950090c5d5be46d40a5f09e8e8295e36215d1dd8
Author: Michael Meeks <michael.meeks at suse.com>
Date: Wed Sep 28 13:48:34 2011 +0100
add new bootstrapfixture to share and simplify unit test code
diff --git a/test/inc/test/bootstrapfixture.hxx b/test/inc/test/bootstrapfixture.hxx
new file mode 100644
index 0000000..791710c
--- /dev/null
+++ b/test/inc/test/bootstrapfixture.hxx
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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) 2011 Michael Meeks <michael.meeks at suse.com>
+ *
+ * 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.
+ */
+#ifndef INCLUDED_TEST_BOOTSTRAPFIXTURE_HXX
+#define INCLUDED_TEST_BOOTSTRAPFIXTURE_HXX
+
+#include <sal/config.h>
+
+#include <rtl/string.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+
+#include "sal/precppunit.hxx"
+#include "cppunit/TestAssert.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
+#include "test/detail/testdllapi.hxx"
+
+namespace test {
+
+// Class to do lots of heavy-lifting UNO & environment
+// bootstrapping for unit tests, such that we can use
+// almost an entire LibreOffice during compile - so
+// that we can get pieces of code alone to beat them up.
+class OOO_DLLPUBLIC_TEST BootstrapFixture : public CppUnit::TestFixture
+{
+ ::rtl::OUString m_aSrcRootURL;
+ ::rtl::OUString m_aSrcRootPath;
+
+ 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 );
+ virtual ~BootstrapFixture();
+
+ com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
+ getComponentContext() { return m_xContext; }
+ com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>
+ getMultiServiceFactory() { return m_xSFactory; }
+
+ ::rtl::OUString getSrcRootURL() { return m_aSrcRootURL; }
+ ::rtl::OUString getSrcRootPath() { return m_aSrcRootPath; }
+
+ // return a URL to a given c-str path from the source directory
+ ::rtl::OUString getURLFromSrc( const char *pPath );
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/prj/build.lst b/test/prj/build.lst
index b223c32..655170f 100644
--- a/test/prj/build.lst
+++ b/test/prj/build.lst
@@ -1,4 +1,4 @@
-te test : BOOST:boost cppu cppuhelper CPPUNIT:cppunit javaunohelper offapi ridljar sal solenv stlport unoil qadevOOo NULL
+te test : BOOST:boost cppu cppuhelper CPPUNIT:cppunit javaunohelper offapi ridljar sal solenv stlport unoil qadevOOo vcl NULL
te test\inc nmake - all inc NULL
te test\source\cpp nmake - all source_cpp inc NULL
te test\source\cpp\unoexceptionprotector nmake - all source_cpp_unoexceptionprotector inc NULL
diff --git a/test/prj/d.lst b/test/prj/d.lst
index 24ec21c..bf4af6d 100644
--- a/test/prj/d.lst
+++ b/test/prj/d.lst
@@ -11,6 +11,7 @@ mkdir: %_DEST%\inc\test\detail
..\inc\test\detail\testdllapi.hxx %_DEST%\inc\test\detail\testdllapi.hxx
..\inc\test\gettestargument.hxx %_DEST%\inc\test\gettestargument.hxx
..\inc\test\officeconnection.hxx %_DEST%\inc\test\officeconnection.hxx
+..\inc\test\bootstrapfixture.hxx %_DEST%\inc\test\bootstrapfixture.hxx
..\inc\test\oustringostreaminserter.hxx %_DEST%\inc\test\oustringostreaminserter.hxx
..\inc\test\toabsolutefileurl.hxx %_DEST%\inc\test\toabsolutefileurl.hxx
..\inc\test\uniquepipename.hxx %_DEST%\inc\test\uniquepipename.hxx
diff --git a/test/source/cpp/bootstrapfixture.cxx b/test/source/cpp/bootstrapfixture.cxx
new file mode 100644
index 0000000..d46cf4d
--- /dev/null
+++ b/test/source/cpp/bootstrapfixture.cxx
@@ -0,0 +1,115 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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) 2011 Michael Meeks <michael.meeks at suse.com>
+ * Caolán McNamara <caolanm at redhat.com>
+ *
+ * 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.
+ */
+#include <test/bootstrapfixture.hxx>
+#include <tools/errinf.hxx>
+#include <rtl/strbuf.hxx>
+#include <cppuhelper/bootstrap.hxx>
+#include <ucbhelper/contentbroker.hxx>
+#include <comphelper/processfactory.hxx>
+
+#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
+#include <vcl/svapp.hxx>
+#include <tools/resmgr.hxx>
+#include <unotools/syslocaleoptions.hxx>
+
+using namespace ::com::sun::star;
+
+static void aBasicErrorFunc( const String &rErr, const String &rAction )
+{
+ rtl::OStringBuffer aErr( "Unexpected dialog: " );
+ aErr.append( rtl::OUStringToOString( rAction, RTL_TEXTENCODING_ASCII_US ) );
+ aErr.append( " Error: " );
+ aErr.append( rtl::OUStringToOString( rErr, RTL_TEXTENCODING_ASCII_US ) );
+ CPPUNIT_ASSERT_MESSAGE( aErr.getStr(), false);
+}
+
+test::BootstrapFixture::BootstrapFixture( bool bAssertOnDialog )
+ : m_aSrcRootURL(RTL_CONSTASCII_USTRINGPARAM("file://"))
+{
+ m_xContext = cppu::defaultBootstrap_InitialComponentContext();
+ m_xFactory = m_xContext->getServiceManager();
+ m_xSFactory = uno::Reference<lang::XMultiServiceFactory> (m_xFactory, uno::UNO_QUERY_THROW);
+
+ //Without this we're crashing because callees are using
+ //getProcessServiceFactory. In general those should be removed in favour
+ //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);
+
+ // force locale (and resource files loaded) to en-US
+ rtl::OUString aLang( RTL_CONSTASCII_USTRINGPARAM( "en" ) );
+ rtl::OUString aCountry( RTL_CONSTASCII_USTRINGPARAM( "US" ) );
+ rtl::OUString aISO( RTL_CONSTASCII_USTRINGPARAM( "en-US" ) );
+ lang::Locale aLocale(aLang, aCountry, rtl::OUString());
+ ResMgr::SetDefaultLocale( aLocale );
+ SvtSysLocaleOptions aLocalOptions;
+ aLocalOptions.SetUILocaleConfigString( aISO );
+
+ InitVCL(m_xSFactory);
+
+ if( bAssertOnDialog )
+ ErrorHandler::RegisterDisplay( aBasicErrorFunc );
+
+ const char* pSrcRoot = getenv( "SRC_ROOT" );
+ CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot != NULL && pSrcRoot[0] != 0);
+
+#ifdef WNT
+ if (pSrcRoot[1] == ':')
+ m_aSrcRootURL += rtl::OUString::createFromAscii( "/" );
+#endif
+ m_aSrcRootPath = rtl::OUString::createFromAscii( pSrcRoot );
+ m_aSrcRootURL += m_aSrcRootPath;
+}
+
+test::BootstrapFixture::~BootstrapFixture()
+{
+ uno::Reference< lang::XComponent >(m_xContext, uno::UNO_QUERY_THROW)->dispose();
+}
+
+::rtl::OUString test::BootstrapFixture::getURLFromSrc( const char *pPath )
+{
+ return m_aSrcRootURL + rtl::OUString::createFromAscii( pPath );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/source/cpp/makefile.mk b/test/source/cpp/makefile.mk
index fd0b2bb..68bca02 100644
--- a/test/source/cpp/makefile.mk
+++ b/test/source/cpp/makefile.mk
@@ -40,6 +40,7 @@ CFLAGSCXX += $(CPPUNIT_CFLAGS)
SLOFILES = \
$(SLO)/getargument.obj \
$(SLO)/gettestargument.obj \
+ $(SLO)/bootstrapfixture.obj \
$(SLO)/officeconnection.obj \
$(SLO)/toabsolutefileurl.obj \
$(SLO)/uniquepipename.obj
@@ -52,7 +53,12 @@ SHL1IMPLIB = i$(SHL1TARGET)
SHL1OBJS = $(SLOFILES)
SHL1RPATH = NONE
SHL1STDLIBS = \
+ $(VCLLIB) \
+ $(TOOLSLIB) \
+ $(UCBHELPERLIB) \
+ $(COMPHELPERLIB) \
$(CPPUHELPERLIB) \
+ $(UNOTOOLSLIB) \
$(CPPULIB) \
$(CPPUNITLIB) \
$(SALLIB)
commit 3ff029819c578ef942ae9c7b03308f54204aabed
Author: Michael Meeks <michael.meeks at suse.com>
Date: Wed Sep 28 13:32:36 2011 +0100
remove obsolete include guard
diff --git a/comphelper/inc/comphelper/processfactory.hxx b/comphelper/inc/comphelper/processfactory.hxx
index b20d730..6f608cc 100644
--- a/comphelper/inc/comphelper/processfactory.hxx
+++ b/comphelper/inc/comphelper/processfactory.hxx
@@ -29,9 +29,7 @@
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
#define _COMPHELPER_PROCESSFACTORY_HXX_
-#if ! defined(_COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HXX_)
-#include "com/sun/star/uno/XComponentContext.hpp"
-#endif
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include "comphelper/comphelperdllapi.h"
More information about the Libreoffice-commits
mailing list