[Libreoffice-commits] core.git: chart2/qa dbaccess/qa framework/qa lotuswordpro/qa oox/qa
Moaz (via logerrit)
logerrit at kemper.freedesktop.org
Thu Feb 25 06:51:10 UTC 2021
chart2/qa/extras/charttest.hxx | 2 --
dbaccess/qa/extras/dialog-save.cxx | 1 -
dbaccess/qa/extras/empty-stdlib-save.cxx | 1 -
dbaccess/qa/extras/macros-test.cxx | 1 -
dbaccess/qa/extras/nolib-save.cxx | 1 -
dbaccess/qa/extras/rowsetclones.cxx | 2 --
dbaccess/qa/unit/dbtest_base.cxx | 2 --
framework/qa/cppunit/dispatchtest.cxx | 1 -
lotuswordpro/qa/cppunit/import_test.cxx | 4 ----
oox/qa/unit/mathml.cxx | 1 -
10 files changed, 16 deletions(-)
New commits:
commit a9a350c13d8fb454c3f1db7ca6a7f10c1e7a19bb
Author: Moaz <moaz.eldefrawy at gmail.com>
AuthorDate: Sun Feb 21 20:22:40 2021 +0200
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Feb 25 07:50:29 2021 +0100
tdf#139734 Remove redundant asserts after MacrosTest::loadFromDesktop
MacrosTest::loadFromDesktop itself asserts on its return value.
Thus, the additional checks in unit tests are redundant, and only create
noise unrelated to the tested functionality.
Change-Id: If616001b296afdde38f5a23ececee3d44b4a395d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111290
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index eeebd0ea237a..8dcdcf98bc50 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -120,7 +120,6 @@ void ChartTest::load( std::u16string_view aDir, const OUString& aName )
if (mxComponent.is())
mxComponent->dispose();
mxComponent = loadFromDesktop(m_directories.getURLFromSrc(aDir) + aName, maServiceName);
- CPPUNIT_ASSERT(mxComponent.is());
}
std::shared_ptr<utl::TempFile> ChartTest::save(const OUString& rFilterName)
@@ -160,7 +159,6 @@ std::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName)
if(!mbSkipValidation)
validate(pTempFile->GetFileName(), test::MSBINARY);
}
- CPPUNIT_ASSERT(mxComponent.is());
return pTempFile;
}
diff --git a/dbaccess/qa/extras/dialog-save.cxx b/dbaccess/qa/extras/dialog-save.cxx
index 5eac41e67041..fc34768bd10f 100644
--- a/dbaccess/qa/extras/dialog-save.cxx
+++ b/dbaccess/qa/extras/dialog-save.cxx
@@ -58,7 +58,6 @@ void DialogSaveTest::test()
const OUString aFileName(m_directories.getURLFromWorkdir(u"CppunitTest/testDialogSave.odb"));
{
uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileName);
- CPPUNIT_ASSERT(xComponent.is());
uno::Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW);
uno::Reference< document::XEmbeddedScripts > xDocScr(xComponent, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries());
diff --git a/dbaccess/qa/extras/empty-stdlib-save.cxx b/dbaccess/qa/extras/empty-stdlib-save.cxx
index aa7dd293004f..978045a2e2e1 100644
--- a/dbaccess/qa/extras/empty-stdlib-save.cxx
+++ b/dbaccess/qa/extras/empty-stdlib-save.cxx
@@ -56,7 +56,6 @@ void DialogSaveTest::test()
const OUString aFileName(m_directories.getURLFromWorkdir(u"CppunitTest/testEmptyStdlibSave.odb"));
{
uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileName);
- CPPUNIT_ASSERT(xComponent.is());
uno::Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW);
uno::Reference< document::XEmbeddedScripts > xDocScr(xComponent, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries());
diff --git a/dbaccess/qa/extras/macros-test.cxx b/dbaccess/qa/extras/macros-test.cxx
index e102c75896b3..6e165ac640ff 100644
--- a/dbaccess/qa/extras/macros-test.cxx
+++ b/dbaccess/qa/extras/macros-test.cxx
@@ -37,7 +37,6 @@ void DBAccessTest::test()
OUString aFileName;
createFileURL(u"testdb.odb", aFileName);
uno::Reference<lang::XComponent> xComponent = loadFromDesktop(aFileName);
- CPPUNIT_ASSERT(xComponent.is());
xComponent->dispose();
}
diff --git a/dbaccess/qa/extras/nolib-save.cxx b/dbaccess/qa/extras/nolib-save.cxx
index e191402425f9..4443bfd4e2b7 100644
--- a/dbaccess/qa/extras/nolib-save.cxx
+++ b/dbaccess/qa/extras/nolib-save.cxx
@@ -56,7 +56,6 @@ void DialogSaveTest::test()
const OUString aFileName(m_directories.getURLFromWorkdir(u"CppunitTest/testNolibSave.odb"));
{
uno::Reference< lang::XComponent > xComponent = loadFromDesktop(aFileName);
- CPPUNIT_ASSERT(xComponent.is());
uno::Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW);
uno::Reference< document::XEmbeddedScripts > xDocScr(xComponent, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries());
diff --git a/dbaccess/qa/extras/rowsetclones.cxx b/dbaccess/qa/extras/rowsetclones.cxx
index d4637c5d8ae6..21a30636961b 100644
--- a/dbaccess/qa/extras/rowsetclones.cxx
+++ b/dbaccess/qa/extras/rowsetclones.cxx
@@ -51,8 +51,6 @@ void RowSetClones::test()
const OUString sFilePath(m_directories.getURLFromWorkdir(u"CppunitTest/RowSetClones.odb"));
uno::Reference< lang::XComponent > xComponent (loadFromDesktop(sFilePath));
- CPPUNIT_ASSERT(xComponent.is());
-
uno::Reference< XOfficeDatabaseDocument > xDocument(xComponent, UNO_QUERY);
CPPUNIT_ASSERT(xDocument.is());
diff --git a/dbaccess/qa/unit/dbtest_base.cxx b/dbaccess/qa/unit/dbtest_base.cxx
index caee25fa70ac..c7992288cdbd 100644
--- a/dbaccess/qa/unit/dbtest_base.cxx
+++ b/dbaccess/qa/unit/dbtest_base.cxx
@@ -67,8 +67,6 @@ uno::Reference< XOfficeDatabaseDocument >
uno::Reference<XOfficeDatabaseDocument> DBTestBase::getDocumentForUrl(OUString const & url) {
uno::Reference< lang::XComponent > xComponent (loadFromDesktop(url));
- CPPUNIT_ASSERT(xComponent.is());
-
uno::Reference< XOfficeDatabaseDocument > xDocument(xComponent, UNO_QUERY);
CPPUNIT_ASSERT(xDocument.is());
diff --git a/framework/qa/cppunit/dispatchtest.cxx b/framework/qa/cppunit/dispatchtest.cxx
index 5a1b79207046..586c4af3b9b0 100644
--- a/framework/qa/cppunit/dispatchtest.cxx
+++ b/framework/qa/cppunit/dispatchtest.cxx
@@ -181,7 +181,6 @@ void DispatchTest::dispatchCommand(const uno::Reference<lang::XComponent>& xComp
CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception)
{
mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
- CPPUNIT_ASSERT(mxComponent.is());
uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
CPPUNIT_ASSERT(xModel.is());
diff --git a/lotuswordpro/qa/cppunit/import_test.cxx b/lotuswordpro/qa/cppunit/import_test.cxx
index efd40267a9f9..fe2128f72ab5 100644
--- a/lotuswordpro/qa/cppunit/import_test.cxx
+++ b/lotuswordpro/qa/cppunit/import_test.cxx
@@ -57,8 +57,6 @@ CPPUNIT_TEST_FIXTURE(LotusWordProTest, testTdf129993)
{
OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf129993.lwp";
getComponent() = loadFromDesktop(aURL);
- CPPUNIT_ASSERT(getComponent().is());
-
uno::Reference<text::XTextDocument> textDocument(getComponent(), uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xParaEnumAccess(textDocument->getText(),
uno::UNO_QUERY);
@@ -74,8 +72,6 @@ CPPUNIT_TEST_FIXTURE(LotusWordProTest, paragraphProperties)
{
OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "paragraphProperties.lwp";
getComponent() = loadFromDesktop(aURL);
- CPPUNIT_ASSERT(getComponent().is());
-
uno::Reference<text::XTextDocument> textDocument(getComponent(), uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xParaEnumAccess(textDocument->getText(),
uno::UNO_QUERY);
diff --git a/oox/qa/unit/mathml.cxx b/oox/qa/unit/mathml.cxx
index 6d502b2933d8..3ab87fcbcc1f 100644
--- a/oox/qa/unit/mathml.cxx
+++ b/oox/qa/unit/mathml.cxx
@@ -49,7 +49,6 @@ CPPUNIT_TEST_FIXTURE(OoxMathmlTest, testImportCharacters)
OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "import-characters.pptx";
// Without the accompanying fix in place, this failed with an assertion failure on import.
getComponent() = loadFromDesktop(aURL);
- CPPUNIT_ASSERT(getComponent().is());
}
CPPUNIT_TEST_FIXTURE(OoxMathmlTest, testImportMce)
More information about the Libreoffice-commits
mailing list