[Libreoffice-commits] core.git: 2 commits - desktop/qa helpcontent2 svl/qa

Miklos Vajna vmiklos at collabora.co.uk
Fri Dec 2 09:04:34 UTC 2016


 desktop/qa/desktop_lib/test_desktop_lib.cxx |    2 -
 helpcontent2                                |    2 -
 svl/qa/unit/items/test_itempool.cxx         |   22 ++++++++++----------
 svl/qa/unit/svl.cxx                         |   14 ++++++-------
 svl/qa/unit/test_INetContentType.cxx        |    4 +--
 svl/qa/unit/test_lngmisc.cxx                |   30 ++++++++++++++--------------
 6 files changed, 37 insertions(+), 37 deletions(-)

New commits:
commit fc2106092d45a2e44d811882bbe60221d96d1834
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Dec 2 10:01:44 2016 +0100

    Updated core
    Project: help  d4d4804eaf0276e2ab3d3a990d66915c75b1cec9
    
    selectcertificate: fix outdated RID bookmarks
    
    So that F1 works in the dialog.
    
    Change-Id: I6204f769118b4f20c420109a5b39fee702d239c6

diff --git a/helpcontent2 b/helpcontent2
index 9daa5f0..d4d4804 160000
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 9daa5f09461d1ae83c3e9273212a0582a728b375
+Subproject commit d4d4804eaf0276e2ab3d3a990d66915c75b1cec9
commit 49f658f568dfae574217ec8f1c72654ffd6855bc
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Dec 2 08:17:32 2016 +0100

    svl: fix loplugin:cppunitassertequals warnings
    
    Change-Id: Ice929418e46ff42517a47dfcd5888a5cce36ae51
    Reviewed-on: https://gerrit.libreoffice.org/31523
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 93ad652..3abc841 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -1644,7 +1644,7 @@ void DesktopLOKTest::testGetFontSubset()
     std::stringstream aStream(pJSON);
     boost::property_tree::read_json(aStream, aTree);
     CPPUNIT_ASSERT( aTree.size() > 0 );
-    CPPUNIT_ASSERT( aTree.get_child("commandName").get_value<std::string>() == ".uno:FontSubset" );
+    CPPUNIT_ASSERT_EQUAL( std::string(".uno:FontSubset"), aTree.get_child("commandName").get_value<std::string>() );
     boost::property_tree::ptree aValues = aTree.get_child("commandValues");
     CPPUNIT_ASSERT( aValues.size() > 0 );
     free(pJSON);
diff --git a/svl/qa/unit/items/test_itempool.cxx b/svl/qa/unit/items/test_itempool.cxx
index 9a4aae2..0f53390 100644
--- a/svl/qa/unit/items/test_itempool.cxx
+++ b/svl/qa/unit/items/test_itempool.cxx
@@ -44,20 +44,20 @@ void PoolItemTest::testPool()
     SfxItemPool *pPool = new SfxItemPool("testpool", 1, 4, aItems);
     SfxItemPool_Impl *pImpl = SfxItemPool_Impl::GetImpl(pPool);
     CPPUNIT_ASSERT(pImpl != nullptr);
-    CPPUNIT_ASSERT(pImpl->maPoolItems.size() == 4);
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), pImpl->maPoolItems.size());
 
     // Poolable
     SfxVoidItem aItemOne( 1 );
     SfxVoidItem aNotherOne( 1 );
 
     {
-        CPPUNIT_ASSERT(pImpl->maPoolItems[0] == nullptr);
+        CPPUNIT_ASSERT(!pImpl->maPoolItems[0]);
         const SfxPoolItem &rVal = pPool->Put(aItemOne);
-        CPPUNIT_ASSERT(rVal == aItemOne);
+        CPPUNIT_ASSERT(bool(rVal == aItemOne));
         CPPUNIT_ASSERT(pImpl->maPoolItems[0] != nullptr);
         const SfxPoolItem &rVal2 = pPool->Put(aNotherOne);
-        CPPUNIT_ASSERT(rVal2 == rVal);
-        CPPUNIT_ASSERT(&rVal2 == &rVal);
+        CPPUNIT_ASSERT(bool(rVal2 == rVal));
+        CPPUNIT_ASSERT_EQUAL(&rVal, &rVal2);
 
         // Clones on Put ...
         CPPUNIT_ASSERT(&rVal2 != &aItemOne);
@@ -70,13 +70,13 @@ void PoolItemTest::testPool()
     SfxVoidItem aItemTwo( 2 );
     SfxVoidItem aNotherTwo( 2 );
     {
-        CPPUNIT_ASSERT(pImpl->maPoolItems[1] == nullptr);
+        CPPUNIT_ASSERT(!pImpl->maPoolItems[1]);
         const SfxPoolItem &rVal = pPool->Put(aItemTwo);
-        CPPUNIT_ASSERT(rVal == aItemTwo);
+        CPPUNIT_ASSERT(bool(rVal == aItemTwo));
         CPPUNIT_ASSERT(pImpl->maPoolItems[1] != nullptr);
 
         const SfxPoolItem &rVal2 = pPool->Put(aNotherTwo);
-        CPPUNIT_ASSERT(rVal2 == rVal);
+        CPPUNIT_ASSERT(bool(rVal2 == rVal));
         CPPUNIT_ASSERT(&rVal2 != &rVal);
     }
 
@@ -93,11 +93,11 @@ void PoolItemTest::testPool()
     const SfxPoolItem &rKeyFour = pPool->Put(aRemoveFour);
     pPool->Put(aNotherFour);
     CPPUNIT_ASSERT(pImpl->maPoolItems[3]->size() > 0);
-    CPPUNIT_ASSERT(pImpl->maPoolItems[3]->maFree.size() == 0);
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pImpl->maPoolItems[3]->maFree.size());
     pPool->Remove(rKeyFour);
-    CPPUNIT_ASSERT(pImpl->maPoolItems[3]->maFree.size() == 1);
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pImpl->maPoolItems[3]->maFree.size());
     pPool->Put(aNotherFour);
-    CPPUNIT_ASSERT(pImpl->maPoolItems[3]->maFree.size() == 0);
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pImpl->maPoolItems[3]->maFree.size());
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(PoolItemTest);
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index b8c3fc3..9804c7e 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -246,8 +246,8 @@ void Test::testNumberFormat()
         size_t nStart = aTests[i].eStart;
         size_t nEnd = aTests[i].eEnd;
 
-        CPPUNIT_ASSERT_MESSAGE("Unexpected number of formats for this category.",
-                               (nEnd - nStart + 1) == aTests[i].nSize);
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected number of formats for this category.",
+                               aTests[i].nSize, (nEnd - nStart + 1));
 
         for (size_t j = nStart; j <= nEnd; ++j)
         {
@@ -291,7 +291,7 @@ void Test::testSharedString()
 {
     // Use shared string as normal, non-shared string, which is allowed.
     SharedString aSS1("Test"), aSS2("Test");
-    CPPUNIT_ASSERT_MESSAGE("Equality check should return true.", aSS1 == aSS2);
+    CPPUNIT_ASSERT_MESSAGE("Equality check should return true.", bool(aSS1 == aSS2));
     SharedString aSS3("test");
     CPPUNIT_ASSERT_MESSAGE("Equality check is case sensitive.", aSS1 != aSS3);
 }
@@ -322,11 +322,11 @@ void Test::testSharedStringPool()
     p2 = aPool.intern(aAndyLower);
     CPPUNIT_ASSERT_MESSAGE("Failed to intern strings.", p1.getData() && p2.getData());
     CPPUNIT_ASSERT_MESSAGE("These two ID's should differ.", p1.getData() != p2.getData());
-    CPPUNIT_ASSERT_MESSAGE("These two ID's should be equal.", p1.getDataIgnoreCase() == p2.getDataIgnoreCase());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("These two ID's should be equal.", p2.getDataIgnoreCase(), p1.getDataIgnoreCase());
     p2 = aPool.intern(aAndyUpper);
     CPPUNIT_ASSERT_MESSAGE("Failed to intern string.", p2.getData());
     CPPUNIT_ASSERT_MESSAGE("These two ID's should differ.", p1.getData() != p2.getData());
-    CPPUNIT_ASSERT_MESSAGE("These two ID's should be equal.", p1.getDataIgnoreCase() == p2.getDataIgnoreCase());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("These two ID's should be equal.", p2.getDataIgnoreCase(), p1.getDataIgnoreCase());
 }
 
 void Test::testSharedStringPoolPurge()
@@ -337,8 +337,8 @@ void Test::testSharedStringPoolPurge()
     aPool.intern("andy");
     aPool.intern("ANDY");
 
-    CPPUNIT_ASSERT_MESSAGE("Wrong string count.", aPool.getCount() == 3);
-    CPPUNIT_ASSERT_MESSAGE("Wrong case insensitive string count.", aPool.getCountIgnoreCase() == 1);
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong string count.", static_cast<size_t>(3), aPool.getCount());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong case insensitive string count.", static_cast<size_t>(1), aPool.getCountIgnoreCase());
 
     // Since no string objects referencing the pooled strings exist, purging
     // the pool should empty it.
diff --git a/svl/qa/unit/test_INetContentType.cxx b/svl/qa/unit/test_INetContentType.cxx
index 7c83a1e..0eea403 100644
--- a/svl/qa/unit/test_INetContentType.cxx
+++ b/svl/qa/unit/test_INetContentType.cxx
@@ -48,7 +48,7 @@ void Test::testBad() {
     CPPUNIT_ASSERT(!INetContentTypes::parse(in, t, s, &ps));
     CPPUNIT_ASSERT(t.isEmpty());
     CPPUNIT_ASSERT(s.isEmpty());
-    CPPUNIT_ASSERT(ps.end() == ps.find("foo"));
+    CPPUNIT_ASSERT(bool(ps.end() == ps.find("foo")));
 }
 
 void Test::testFull() {
@@ -78,7 +78,7 @@ void Test::testFollow() {
     CPPUNIT_ASSERT(!INetContentTypes::parse(in, t, s));
     CPPUNIT_ASSERT(t.isEmpty());
     CPPUNIT_ASSERT(s.isEmpty());
-    CPPUNIT_ASSERT(ps.end() == ps.find("baz"));
+    CPPUNIT_ASSERT(bool(ps.end() == ps.find("baz")));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/svl/qa/unit/test_lngmisc.cxx b/svl/qa/unit/test_lngmisc.cxx
index 4b5596c..7ba9803 100644
--- a/svl/qa/unit/test_lngmisc.cxx
+++ b/svl/qa/unit/test_lngmisc.cxx
@@ -57,7 +57,7 @@ namespace
     // Note that '-' isn't a hyphen to RemoveHyphens.
     bModified = linguistic::RemoveHyphens(str2);
     CPPUNIT_ASSERT(!bModified);
-    CPPUNIT_ASSERT( str2 == "a-b--c---" );
+    CPPUNIT_ASSERT_EQUAL( OUString("a-b--c---"), str2 );
 
     bModified = linguistic::RemoveHyphens(str3);
     CPPUNIT_ASSERT(bModified);
@@ -65,7 +65,7 @@ namespace
 
     bModified = linguistic::RemoveHyphens(str4);
     CPPUNIT_ASSERT(!bModified);
-    CPPUNIT_ASSERT( str4 == "asdf" );
+    CPPUNIT_ASSERT_EQUAL( OUString("asdf"), str4 );
   }
 
   void LngMiscTest::testRemoveControlChars()
@@ -88,15 +88,15 @@ namespace
 
     bModified = linguistic::RemoveControlChars(str2);
     CPPUNIT_ASSERT(!bModified);
-    CPPUNIT_ASSERT( str2 == "asdf" );
+    CPPUNIT_ASSERT_EQUAL( OUString("asdf"), str2 );
 
     bModified = linguistic::RemoveControlChars(str3);
     CPPUNIT_ASSERT(bModified);
-    CPPUNIT_ASSERT( str3 == "asdfasdf" );
+    CPPUNIT_ASSERT_EQUAL( OUString("asdfasdf"), str3 );
 
     bModified = linguistic::RemoveControlChars(str4);
     CPPUNIT_ASSERT(bModified);
-    CPPUNIT_ASSERT( str4 == " " );
+    CPPUNIT_ASSERT_EQUAL( OUString(" "), str4 );
   }
 
   void LngMiscTest::testReplaceControlChars()
@@ -119,17 +119,17 @@ namespace
 
     bModified = linguistic::ReplaceControlChars(str2);
     CPPUNIT_ASSERT(!bModified);
-    CPPUNIT_ASSERT( str2 == "asdf" );
+    CPPUNIT_ASSERT_EQUAL( OUString("asdf"), str2 );
 
     bModified = linguistic::ReplaceControlChars(str3);
     CPPUNIT_ASSERT(bModified);
-    CPPUNIT_ASSERT( str3 == "asdf asdf" );
+    CPPUNIT_ASSERT_EQUAL(OUString("asdf asdf"),  str3 );
 
     bModified = linguistic::ReplaceControlChars(str4);
     CPPUNIT_ASSERT(bModified);
-    CPPUNIT_ASSERT(str4.getLength() == 32);
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(32), str4.getLength());
     for(int i = 0; i < 32; i++)
-      CPPUNIT_ASSERT(str4[i] == ' ');
+        CPPUNIT_ASSERT_EQUAL(static_cast<sal_Unicode>(' '), str4[i]);
   }
 
   void LngMiscTest::testGetThesaurusReplaceText()
@@ -147,22 +147,22 @@ namespace
     CPPUNIT_ASSERT(r.isEmpty());
 
     r = linguistic::GetThesaurusReplaceText(str2);
-    CPPUNIT_ASSERT(r == str2);
+    CPPUNIT_ASSERT_EQUAL(str2, r);
 
     r = linguistic::GetThesaurusReplaceText(str3);
-    CPPUNIT_ASSERT(r == str2);
+    CPPUNIT_ASSERT_EQUAL(str2, r);
 
     r = linguistic::GetThesaurusReplaceText(str4);
-    CPPUNIT_ASSERT(r == str2);
+    CPPUNIT_ASSERT_EQUAL(str2, r);
 
     r = linguistic::GetThesaurusReplaceText(str5);
-    CPPUNIT_ASSERT(r == str2);
+    CPPUNIT_ASSERT_EQUAL(str2, r);
 
     r = linguistic::GetThesaurusReplaceText(str6);
-    CPPUNIT_ASSERT(r == str2);
+    CPPUNIT_ASSERT_EQUAL(str2, r);
 
     r = linguistic::GetThesaurusReplaceText(str7);
-    CPPUNIT_ASSERT(r == "asdf asdf");
+    CPPUNIT_ASSERT_EQUAL(OUString("asdf asdf"), r);
 
     r = linguistic::GetThesaurusReplaceText(str8);
     CPPUNIT_ASSERT(r.isEmpty());


More information about the Libreoffice-commits mailing list