diff options
author | Moaz <moaz.eldefrawy@gmail.com> | 2021-02-25 15:52:06 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-03-05 08:36:52 +0100 |
commit | dbbda04d52e75858840ce9748a19a61a1c565149 (patch) | |
tree | 66c2d38ff6b0ef77dae47962050e93614b054db1 | |
parent | 5146d482a20494069670496786a1ba3037e979ce (diff) |
tdf#139734 Remove redundant asserts after functions loadFromDesktop and load
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.
SwModelTestBase::load calls SwModelTestBase::loadURL which calls loadFromDesktop from within.
Change-Id: I30061bbc6e13e05f0cfbf17a7910926070b996f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111547
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | sw/qa/api/SwXDocumentSettings.cxx | 2 | ||||
-rw-r--r-- | sw/qa/api/SwXTextField.cxx | 1 | ||||
-rw-r--r-- | sw/qa/api/SwXTextTable.cxx | 1 | ||||
-rw-r--r-- | sw/qa/api/terminate.cxx | 1 | ||||
-rw-r--r-- | sw/qa/core/macros-test.cxx | 6 | ||||
-rw-r--r-- | sw/qa/extras/layout/layout2.cxx | 3 | ||||
-rw-r--r-- | sw/qa/extras/mailmerge/mailmerge.cxx | 1 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 1 | ||||
-rw-r--r-- | test/source/sheet/xspreadsheets2.cxx | 3 | ||||
-rw-r--r-- | vcl/qa/cppunit/pdfexport/pdfexport.cxx | 40 | ||||
-rw-r--r-- | writerperfect/qa/unit/EPUBExportTest.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/qa/unit/signing/signing.cxx | 18 | ||||
-rw-r--r-- | xmlsecurity/qa/unit/signing/signing2.cxx | 3 |
13 files changed, 0 insertions, 82 deletions
diff --git a/sw/qa/api/SwXDocumentSettings.cxx b/sw/qa/api/SwXDocumentSettings.cxx index 6345a053adc4..da2b366dae94 100644 --- a/sw/qa/api/SwXDocumentSettings.cxx +++ b/sw/qa/api/SwXDocumentSettings.cxx @@ -74,8 +74,6 @@ void SwXDocumentSettings::tearDown() uno::Reference<uno::XInterface> SwXDocumentSettings::init() { mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument"); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY_THROW); uno::Reference<lang::XMultiServiceFactory> xFactory(xTextDocument, uno::UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTextField.cxx b/sw/qa/api/SwXTextField.cxx index 7bd56f809468..27a6eb40891c 100644 --- a/sw/qa/api/SwXTextField.cxx +++ b/sw/qa/api/SwXTextField.cxx @@ -73,7 +73,6 @@ void SwXTextField::triggerDesktopTerminate() { mxDesktop->terminate(); } Reference<XInterface> SwXTextField::init() { component_ = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument"); - CPPUNIT_ASSERT(component_.is()); Reference<text::XTextDocument> xTextDocument(component_, UNO_QUERY_THROW); Reference<lang::XMultiServiceFactory> xMSF(component_, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTextTable.cxx b/sw/qa/api/SwXTextTable.cxx index 8f8f18062e7e..71a3a502cabc 100644 --- a/sw/qa/api/SwXTextTable.cxx +++ b/sw/qa/api/SwXTextTable.cxx @@ -69,7 +69,6 @@ void SwXTextTable::triggerDesktopTerminate() { mxDesktop->terminate(); } Reference<XInterface> SwXTextTable::init() { component_ = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument"); - CPPUNIT_ASSERT(component_.is()); Reference<text::XTextDocument> xTextDocument(component_, UNO_QUERY_THROW); Reference<lang::XMultiServiceFactory> xMSF(component_, UNO_QUERY_THROW); Reference<text::XText> xText = xTextDocument->getText(); diff --git a/sw/qa/api/terminate.cxx b/sw/qa/api/terminate.cxx index 5f077d0aa1f8..9a0e26d4d7e2 100644 --- a/sw/qa/api/terminate.cxx +++ b/sw/qa/api/terminate.cxx @@ -53,7 +53,6 @@ css::uno::Reference<css::uno::XInterface> TerminateTest::init() { auto const component = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument"); - CPPUNIT_ASSERT(component.is()); css::uno::Reference<css::text::XTextDocument> xTextDocument(component, css::uno::UNO_QUERY_THROW); css::uno::Reference<css::lang::XMultiServiceFactory> xMSF(component, css::uno::UNO_QUERY_THROW); diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index cb2616333486..3a693af4ab0d 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -113,9 +113,6 @@ void SwMacrosTest::testVba() OUString aFileName; createFileURL(testInfo[i].sFileBaseName, u"doc", aFileName); uno::Reference< css::lang::XComponent > xComponent = loadFromDesktop(aFileName, "com.sun.star.text.TextDocument"); - OUString sMsg = "Failed to load " + aFileName; - CPPUNIT_ASSERT_MESSAGE( OUStringToOString( sMsg, RTL_TEXTENCODING_UTF8 ).getStr(), xComponent.is() ); - OUString sUrl = testInfo[i].sMacroUrl; Any aRet; Sequence< sal_Int16 > aOutParamIndex; @@ -349,9 +346,6 @@ void SwMacrosTest::testFdo68983() createFileURL(u"fdo68983.", u"odt", aFileName); Reference< css::lang::XComponent > xComponent = loadFromDesktop(aFileName, "com.sun.star.text.TextDocument"); - - CPPUNIT_ASSERT_MESSAGE("Failed to load fdo68983.odt", xComponent.is()); - Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW); utl::TempFile aTempFile; diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 0b3f23d48bc7..12eb3b77e9c0 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -1781,9 +1781,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf122607_regression) // inline the loading because currently properties can't be passed... mxComponent = loadFromDesktop(url, "com.sun.star.text.TextDocument", comphelper::containerToSequence(aFilterOptions)); - - CPPUNIT_ASSERT(mxComponent.is()); - uno::Sequence<beans::PropertyValue> props(comphelper::InitPropertySequence({ { "FilterName", uno::Any(OUString("writer_pdf_Export")) }, })); diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 824c4bbd60e5..83cbee5580ac 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -247,7 +247,6 @@ public: std::cout << filename << ","; mnStartTime = osl_getGlobalTimer(); mxComponent = loadFromDesktop(msMailMergeOutputURL + "/" + filename, "com.sun.star.text.TextDocument"); - CPPUNIT_ASSERT( mxComponent.is()); OString name2 = OUStringToOString( filename, RTL_TEXTENCODING_UTF8 ); discardDumpedLayout(); if (mustCalcLayoutOf(name2.getStr())) diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index cfb22cd86ca2..fa5209497862 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -4455,7 +4455,6 @@ void SwUiWriterTest::testEmbeddedDataSource() // Load: should have a component and a data source, too. // Path with "#" must not cause issues load(OUString(DATA_DIRECTORY + OUStringLiteral(u"hash%23path/")), "embedded-data-source.odt"); - CPPUNIT_ASSERT(mxComponent.is()); CPPUNIT_ASSERT(xDatabaseContext->hasByName("calc-data-source")); // Data source has a table named Sheet1. diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx index 9c53af7374fb..406d8baf118a 100644 --- a/test/source/sheet/xspreadsheets2.cxx +++ b/test/source/sheet/xspreadsheets2.cxx @@ -323,9 +323,6 @@ uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const OUStri createFileURL(aFileBase, aFileURL); uno::Reference< lang::XComponent > xComp = loadFromDesktop(aFileURL); - - CPPUNIT_ASSERT(xComp.is()); - uno::Reference< sheet::XSpreadsheetDocument > xDoc(xComp, UNO_QUERY_THROW); return xDoc; } diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index f9d389777fbb..365a9a0955c1 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -83,8 +83,6 @@ PdfExportTest::exportAndParse(const OUString& rURL, const utl::MediaDescriptor& { // Import the bugdoc and export as PDF. mxComponent = loadFromDesktop(rURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(maTempFile.GetURL(), rDescriptor.getAsConstPropertyValueList()); @@ -122,8 +120,6 @@ void PdfExportTest::saveAsPDF(std::u16string_view rFile) // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + rFile; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -145,8 +141,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106059) // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf106059.odt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -232,8 +226,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf105461) // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf105461.odp"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -280,8 +272,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107868) // Import the bugdoc and print to PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf107868.odt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); uno::Reference<view::XPrintable> xPrintable(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xPrintable.is()); @@ -369,8 +359,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106206) // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf106206.odt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -419,8 +407,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf109143) // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf109143.odt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -460,8 +446,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106972) // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf106972.odt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -510,8 +494,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106972Pdf17) // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf106972-pdf17.odt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -550,8 +532,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testSofthyphenPos) // Import the bugdoc and print to PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "softhyphen_pdf.odt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); uno::Reference<view::XPrintable> xPrintable(mxComponent, uno::UNO_QUERY); CPPUNIT_ASSERT(xPrintable.is()); @@ -810,8 +790,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf108963) // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf108963.odp"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -1063,8 +1041,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf115117_1a) // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf115117-1.odt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -1110,8 +1086,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf115117_2a) // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf115117-2.odt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -1440,8 +1414,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf105954) // Import the bugdoc and export as PDF. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf105954.odt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -1769,7 +1741,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTocLink) // Load the Writer document. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "toc-link.fodt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); // Update the ToC. uno::Reference<text::XDocumentIndexesSupplier> xDocumentIndexesSupplier(mxComponent, @@ -1947,7 +1918,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testPdfImageResourceInlineXObjectRef) { // Create an empty document. mxComponent = loadFromDesktop("private:factory/swriter"); - CPPUNIT_ASSERT(mxComponent.is()); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<text::XText> xText = xTextDocument->getText(); uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor(); @@ -2020,7 +1990,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testDefaultVersion) { // Create an empty document. mxComponent = loadFromDesktop("private:factory/swriter"); - CPPUNIT_ASSERT(mxComponent.is()); // Save as PDF. uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -2043,7 +2012,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testVersion15) { // Create an empty document. mxComponent = loadFromDesktop("private:factory/swriter"); - CPPUNIT_ASSERT(mxComponent.is()); // Save as PDF. uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); @@ -2090,8 +2058,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testMultiPagePDF) // Load the PDF and save as PDF OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "SimpleMultiPagePDF.pdf"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -2273,8 +2239,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testReexportPDF) // Load the PDF and save as PDF OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "PDFWithImages.pdf"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -2489,8 +2453,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testReexportDocumentWithComplexResources) // Load the PDF and save as PDF OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "ComplexContentDictionary.pdf"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); @@ -2579,8 +2541,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testPdfUaMetadata) // Import a basic document (document doesn't really matter) OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "BrownFoxLazyDog.odt"; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx index d703c9fa61f6..c1769607605a 100644 --- a/writerperfect/qa/unit/EPUBExportTest.cxx +++ b/writerperfect/qa/unit/EPUBExportTest.cxx @@ -94,8 +94,6 @@ void EPUBExportTest::createDoc(std::u16string_view rFile, // Import the bugdoc and export as EPUB. OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + rFile; mxComponent = loadFromDesktop(aURL); - CPPUNIT_ASSERT(mxComponent.is()); - uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); maTempFile.EnableKillingFile(); utl::MediaDescriptor aMediaDescriptor; diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index a76b14252a21..cfe9c749cff0 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -1079,8 +1079,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature12_ODF) // load the template as-is to validate signatures mxComponent = loadFromDesktop( aURL, OUString(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); // we are a template, and have a valid document and macro signature assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::OK, SignatureState::OK, @@ -1132,8 +1130,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature12_ODF) mxComponent = loadFromDesktop(aTempFileSaveAsOTT.GetURL(), OUString(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); // the loaded document is a OTT with a valid macro signature assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::NOSIGNATURES, @@ -1166,8 +1162,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature12_ODF) mxComponent = loadFromDesktop(aTempFileSaveAsODT_OTT.GetURL(), OUString(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); // the loaded document is a OTT with a valid macro signature assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::NOSIGNATURES, @@ -1183,8 +1177,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDropMacroTemplateSignature) // load the template as-is to validate signatures mxComponent = loadFromDesktop( aURL, OUString(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); // we are a template, and have a non-invalid macro signature assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::NOSIGNATURES, @@ -1227,8 +1219,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDropMacroTemplateSignature) mxComponent->dispose(); mxComponent = loadFromDesktop( aURL, OUString(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); // we are a template, and have a non-invalid macro signature assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::NOSIGNATURES, @@ -1254,8 +1244,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDropMacroTemplateSignature) mxComponent = loadFromDesktop(aTempFileSaveAsOTT.GetURL(), OUString(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); // the loaded document is a 1.2 OTT without any signatures assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::NOSIGNATURES, @@ -1283,8 +1271,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature10) // load the template as-is to validate signatures mxComponent = loadFromDesktop( aURL, OUString(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); // we are a template, and have a non-invalid macro signature assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::NOSIGNATURES, @@ -1336,8 +1322,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature10) mxComponent = loadFromDesktop(aTempFileSaveAsOTT.GetURL(), OUString(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); // the loaded document is a OTT with a non-invalid macro signature assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::NOSIGNATURES, @@ -1370,8 +1354,6 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPreserveMacroTemplateSignature10) mxComponent = loadFromDesktop(aTempFileSaveAsODT_OTT.GetURL(), OUString(), comphelper::InitPropertySequence({ { "AsTemplate", uno::Any(false) } })); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); // the loaded document is a OTT with a non-invalid macro signature assertDocument(CPPUNIT_SOURCELINE(), "writer8_template", SignatureState::NOSIGNATURES, diff --git a/xmlsecurity/qa/unit/signing/signing2.cxx b/xmlsecurity/qa/unit/signing/signing2.cxx index e23c5530a76c..a436711ca02d 100644 --- a/xmlsecurity/qa/unit/signing/signing2.cxx +++ b/xmlsecurity/qa/unit/signing/signing2.cxx @@ -78,12 +78,9 @@ void SigningTest2::tearDown() CPPUNIT_TEST_FIXTURE(SigningTest2, testPreserveMacroSignatureODB) { const OUString aURL(m_directories.getURLFromSrc(DATA_DIRECTORY) + "odb_signed_macros.odb"); - const OUString sLoadMessage = "loading failed: " + aURL; // load the file mxComponent = loadFromDesktop(aURL, "com.sun.star.sdb.OfficeDatabaseDocument"); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sLoadMessage, RTL_TEXTENCODING_UTF8).getStr(), - mxComponent.is()); // save as ODB utl::TempFile aTempFileSaveAsODB; |