summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-09-28 15:32:14 +0100
committerMichael Meeks <michael.meeks@suse.com>2011-09-28 15:32:14 +0100
commit2f3d6644197a98e1c191df7943da3e50e80d606f (patch)
treea971104082da6843e73209e35b77abab2f3c463d /sc
parentdisable use of test's unoexceptionprotector for now, to break dep loop (diff)
downloadcore-2f3d6644197a98e1c191df7943da3e50e80d606f.tar.gz
core-2f3d6644197a98e1c191df7943da3e50e80d606f.zip
more unit test cut/paste redux
Diffstat (limited to 'sc')
-rw-r--r--sc/CppunitTest_sc_ucalc.mk1
-rw-r--r--sc/qa/unit/filters-test.cxx4
-rw-r--r--sc/qa/unit/ucalc.cxx85
3 files changed, 3 insertions, 87 deletions
diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index c7a6b2f81b66..5bd1e5c160dc 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -63,6 +63,7 @@ $(eval $(call gb_CppunitTest_add_linked_libs,sc_ucalc, \
svt \
svx \
svxcore \
+ test \
tk \
tl \
ucbhelper \
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 45916ff3f384..dfc4cc9db6da 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -29,12 +29,8 @@
#include <sal/config.h>
#include <test/bootstrapfixture.hxx>
-
#include <rtl/strbuf.hxx>
#include <osl/file.hxx>
-#include <osl/process.h>
-
-#include <tools/urlobj.hxx>
#include <sfx2/app.hxx>
#include <sfx2/docfilt.hxx>
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b3f6fd3f8ad9..aae35e3e8633 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -26,39 +26,12 @@
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
-
-// TODO ...
-// officecfg: can we move this into our skeleton ?
-// Solve the Setup.xcu problem pleasantly [ custom version ? ]
-// deliver.pl
-// don't call regcomp if we don't have it.
-// In an ideal world
-// a) scp2 goes away and logic moved into the deliver d.lst
-// b) install set gets built incrementally as the build progresses
-// c) the new .xml component registration stuff then removes
-// the need for manually calling regcomp and knowing what
-// services we need, and in what .so they are implemented
-
-
#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/bootstrap.hxx>
-#include <comphelper/processfactory.hxx>
-#include <comphelper/oslfile2streamwrap.hxx>
-#include <i18npool/mslangid.hxx>
-#include <unotools/syslocaleoptions.hxx>
-#include <vcl/svapp.hxx>
#include "scdll.hxx"
#include "document.hxx"
#include "stringutil.hxx"
@@ -234,10 +207,9 @@ private:
MatrixType maMatrix;
};
-class Test : public CppUnit::TestFixture {
+class Test : public test::BootstrapFixture {
public:
Test();
- ~Test();
virtual void setUp();
virtual void tearDown();
@@ -312,62 +284,14 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- uno::Reference< uno::XComponentContext > m_xContext;
ScDocument *m_pDoc;
ScDocShellRef m_xDocShRef;
- ::rtl::OUString m_aSrcRoot;
};
Test::Test()
: m_pDoc(0)
- , m_aSrcRoot(RTL_CONSTASCII_USTRINGPARAM("file://"))
{
- m_xContext = cppu::defaultBootstrap_InitialComponentContext();
-
- uno::Reference<lang::XMultiComponentFactory> xFactory(m_xContext->getServiceManager());
- uno::Reference<lang::XMultiServiceFactory> xSM(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);
ScDLL::Init();
-
- 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 Test::setUp()
@@ -385,11 +309,6 @@ void Test::tearDown()
m_xDocShRef.Clear();
}
-Test::~Test()
-{
- uno::Reference< lang::XComponent >(m_xContext, uno::UNO_QUERY_THROW)->dispose();
-}
-
void Test::testCollator()
{
OUString s1(RTL_CONSTASCII_USTRINGPARAM("A"));