diff options
Diffstat (limited to 'unotest')
-rw-r--r-- | unotest/source/cpp/bootstrapfixturebase.cxx | 13 | ||||
-rw-r--r-- | unotest/source/cpp/directories.cxx | 22 | ||||
-rw-r--r-- | unotest/source/cpp/getargument.cxx | 8 | ||||
-rw-r--r-- | unotest/source/cpp/gettestargument.cxx | 8 | ||||
-rw-r--r-- | unotest/source/cpp/macros_test.cxx | 14 |
5 files changed, 32 insertions, 33 deletions
diff --git a/unotest/source/cpp/bootstrapfixturebase.cxx b/unotest/source/cpp/bootstrapfixturebase.cxx index 4b93b1d6de94..5c5b3bcc3a9c 100644 --- a/unotest/source/cpp/bootstrapfixturebase.cxx +++ b/unotest/source/cpp/bootstrapfixturebase.cxx @@ -19,13 +19,9 @@ using namespace ::com::sun::star; // test function in a rather non-intuitive way. This is why all the 'real' // heavy lifting is deferred until setUp. setUp and tearDown are interleaved // between the tests as you might expect. -test::BootstrapFixtureBase::BootstrapFixtureBase() -{ -} +test::BootstrapFixtureBase::BootstrapFixtureBase() {} -test::BootstrapFixtureBase::~BootstrapFixtureBase() -{ -} +test::BootstrapFixtureBase::~BootstrapFixtureBase() {} void test::BootstrapFixtureBase::setUp() { @@ -34,9 +30,6 @@ void test::BootstrapFixtureBase::setUp() m_xSFactory.set(m_xFactory, uno::UNO_QUERY_THROW); } -void test::BootstrapFixtureBase::tearDown() -{ - StarBASIC::DetachAllDocBasicItems(); -} +void test::BootstrapFixtureBase::tearDown() { StarBASIC::DetachAllDocBasicItems(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unotest/source/cpp/directories.cxx b/unotest/source/cpp/directories.cxx index 6635fafa030f..54f106b212d6 100644 --- a/unotest/source/cpp/directories.cxx +++ b/unotest/source/cpp/directories.cxx @@ -13,31 +13,33 @@ #include <osl/file.hxx> #include <unotest/directories.hxx> -namespace { - -OUString getFileURLFromSystemPath(OUString const & path) { +namespace +{ +OUString getFileURLFromSystemPath(OUString const& path) +{ OUString url; osl::FileBase::RC e = osl::FileBase::getFileURLFromSystemPath(path, url); CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, e); - if (!url.endsWith("/")) { + if (!url.endsWith("/")) + { url += "/"; } return url; } - } -test::Directories::Directories() { - const char* pSrcRoot = getenv( "SRC_ROOT" ); +test::Directories::Directories() +{ + const char* pSrcRoot = getenv("SRC_ROOT"); CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot != nullptr); CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot[0] != 0); - const char* pWorkdirRoot = getenv( "WORKDIR_FOR_BUILD" ); + const char* pWorkdirRoot = getenv("WORKDIR_FOR_BUILD"); CPPUNIT_ASSERT_MESSAGE("$WORKDIR_FOR_BUILD env variable not set", pWorkdirRoot != nullptr); CPPUNIT_ASSERT_MESSAGE("$WORKDIR_FOR_BUILD env variable not set", pWorkdirRoot[0] != 0); - m_aSrcRootPath = OUString::createFromAscii( pSrcRoot ); + m_aSrcRootPath = OUString::createFromAscii(pSrcRoot); m_aSrcRootURL = getFileURLFromSystemPath(m_aSrcRootPath); - m_aWorkdirRootPath = OUString::createFromAscii( pWorkdirRoot ); + m_aWorkdirRootPath = OUString::createFromAscii(pWorkdirRoot); m_aWorkdirRootURL = getFileURLFromSystemPath(m_aWorkdirRootPath); } diff --git a/unotest/source/cpp/getargument.cxx b/unotest/source/cpp/getargument.cxx index 007cc775b7d7..cb1df427758e 100644 --- a/unotest/source/cpp/getargument.cxx +++ b/unotest/source/cpp/getargument.cxx @@ -25,13 +25,13 @@ #include "getargument.hxx" -namespace test::detail { - -bool getArgument(OUString const & name, OUString * value) { +namespace test::detail +{ +bool getArgument(OUString const& name, OUString* value) +{ OSL_ASSERT(value != nullptr); return rtl::Bootstrap::get("arg-" + name, *value); } - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unotest/source/cpp/gettestargument.cxx b/unotest/source/cpp/gettestargument.cxx index 93ba6dbe639d..1c69cc9c6196 100644 --- a/unotest/source/cpp/gettestargument.cxx +++ b/unotest/source/cpp/gettestargument.cxx @@ -24,12 +24,12 @@ #include "getargument.hxx" -namespace test { - -bool getTestArgument(OUString const & name, OUString * value) { +namespace test +{ +bool getTestArgument(OUString const& name, OUString* value) +{ return detail::getArgument("testarg." + name, value); } - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unotest/source/cpp/macros_test.cxx b/unotest/source/cpp/macros_test.cxx index dfd7d758153f..a6d690e0d2c1 100644 --- a/unotest/source/cpp/macros_test.cxx +++ b/unotest/source/cpp/macros_test.cxx @@ -26,8 +26,8 @@ using namespace css; -namespace unotest { - +namespace unotest +{ MacrosTest::MacrosTest() : mpDll(std::make_unique<BasicDLL>()) { @@ -35,7 +35,9 @@ MacrosTest::MacrosTest() MacrosTest::~MacrosTest() = default; -uno::Reference<css::lang::XComponent> MacrosTest::loadFromDesktop(const OUString& rURL, const OUString& rDocService, const uno::Sequence<beans::PropertyValue>& rExtraArgs) +uno::Reference<css::lang::XComponent> +MacrosTest::loadFromDesktop(const OUString& rURL, const OUString& rDocService, + const uno::Sequence<beans::PropertyValue>& rExtraArgs) { CPPUNIT_ASSERT_MESSAGE("no desktop", mxDesktop.is()); std::vector<beans::PropertyValue> args; @@ -58,9 +60,11 @@ uno::Reference<css::lang::XComponent> MacrosTest::loadFromDesktop(const OUString args.insert(args.end(), rExtraArgs.begin(), rExtraArgs.end()); - uno::Reference<lang::XComponent> xComponent = mxDesktop->loadComponentFromURL(rURL, "_default", 0, comphelper::containerToSequence(args)); + uno::Reference<lang::XComponent> xComponent = mxDesktop->loadComponentFromURL( + rURL, "_default", 0, comphelper::containerToSequence(args)); OUString sMessage = "loading failed: " + rURL; - CPPUNIT_ASSERT_MESSAGE(OUStringToOString( sMessage, RTL_TEXTENCODING_UTF8 ).getStr( ), xComponent.is()); + CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sMessage, RTL_TEXTENCODING_UTF8).getStr(), + xComponent.is()); return xComponent; } |