libreofficekit/qa/unit/tiledrendering.cxx | 16 ++++++++-------- sw/qa/core/test_ToxLinkProcessor.cxx | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-)
New commits: commit 777a15db74a48ec5341e5b835240db3050605649 Author: Miklos Vajna <[email protected]> Date: Fri Jan 27 09:13:31 2017 +0100 CppunitTest_libreofficekit_tiledrendering: fix cppunitassertequals warnings Change-Id: I0fce00d4c794918e5b14b2c4f3f9f36231f28718 Reviewed-on: https://gerrit.libreoffice.org/33604 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins <[email protected]> diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx index 1df2eff..5987d14 100644 --- a/libreofficekit/qa/unit/tiledrendering.cxx +++ b/libreofficekit/qa/unit/tiledrendering.cxx @@ -144,7 +144,7 @@ void TiledRenderingTest::testDocumentTypes( Office* pOffice ) // FIXME: same comment as below wrt lockfile removal. remove( sPresentationLockFile.c_str() ); - CPPUNIT_ASSERT( getDocumentType( pOffice, sPresentationDocPath ) == LOK_DOCTYPE_PRESENTATION ); + CPPUNIT_ASSERT_EQUAL(LOK_DOCTYPE_PRESENTATION, static_cast<LibreOfficeKitDocumentType>(getDocumentType(pOffice, sPresentationDocPath))); // TODO: do this for all supported document types } @@ -162,9 +162,9 @@ void TiledRenderingTest::testImpressSlideNames( Office* pOffice ) std::unique_ptr< Document> pDocument( pOffice->documentLoad( sDocPath.c_str() ) ); - CPPUNIT_ASSERT( pDocument->getParts() == 3 ); - CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 0 ), "TestText1" ) == 0 ); - CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 1 ), "TestText2" ) == 0 ); + CPPUNIT_ASSERT_EQUAL(3, pDocument->getParts()); + CPPUNIT_ASSERT_EQUAL(std::string("TestText1"), std::string(pDocument->getPartName(0))); + CPPUNIT_ASSERT_EQUAL(std::string("TestText2"), std::string(pDocument->getPartName(1))); // The third slide hasn't had a name given to it (i.e. using the rename // context menu in Impress), thus it should (as far as I can determine) // have a localised version of "Slide 3". @@ -180,10 +180,10 @@ void TiledRenderingTest::testCalcSheetNames( Office* pOffice ) std::unique_ptr< Document> pDocument( pOffice->documentLoad( sDocPath.c_str() ) ); - CPPUNIT_ASSERT( pDocument->getParts() == 3 ); - CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 0 ), "TestText1" ) == 0 ); - CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 1 ), "TestText2" ) == 0 ); - CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 2 ), "Sheet3" ) == 0 ); + CPPUNIT_ASSERT_EQUAL(3, pDocument->getParts()); + CPPUNIT_ASSERT_EQUAL(std::string("TestText1"), std::string(pDocument->getPartName(0))); + CPPUNIT_ASSERT_EQUAL(std::string("TestText2"), std::string(pDocument->getPartName(1))); + CPPUNIT_ASSERT_EQUAL(std::string("Sheet3"), std::string(pDocument->getPartName(2))); } #if 0 diff --git a/sw/qa/core/test_ToxLinkProcessor.cxx b/sw/qa/core/test_ToxLinkProcessor.cxx index d2d4721..d630979 100644 --- a/sw/qa/core/test_ToxLinkProcessor.cxx +++ b/sw/qa/core/test_ToxLinkProcessor.cxx @@ -73,7 +73,7 @@ ToxLinkProcessorTest::NoExceptionIsThrownIfTooManyLinksAreClosed() sut.CloseLink(2, URL_1); CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned>(sut.m_ClosedLinks.size())); CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned>(sut.m_ClosedLinks.at(0)->mEndTextPos)); - CPPUNIT_ASSERT_MESSAGE("no links are open", sut.m_pStartedLink == nullptr); + CPPUNIT_ASSERT_MESSAGE("no links are open", !sut.m_pStartedLink); } void @@ -87,7 +87,7 @@ ToxLinkProcessorTest::AddingAndClosingTwoOverlappingLinksResultsInOneClosedLink( // (for backward compatibility) sut.CloseLink(1, URL_2); CPPUNIT_ASSERT_EQUAL(1u, static_cast<unsigned>(sut.m_ClosedLinks.size())); - CPPUNIT_ASSERT_MESSAGE("no links are open", sut.m_pStartedLink == nullptr); + CPPUNIT_ASSERT_MESSAGE("no links are open", !sut.m_pStartedLink); // backward compatibility: the last start is closed by the first end CPPUNIT_ASSERT_EQUAL(STYLE_NAME_2, sut.m_ClosedLinks[0]->mINetFormat.GetINetFormat()); CPPUNIT_ASSERT_EQUAL(URL_1, sut.m_ClosedLinks[0]->mINetFormat.GetValue()); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
