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 /xmlsecurity | |
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>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/qa/unit/signing/signing.cxx | 18 | ||||
-rw-r--r-- | xmlsecurity/qa/unit/signing/signing2.cxx | 3 |
2 files changed, 0 insertions, 21 deletions
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; |