summaryrefslogtreecommitdiff
path: root/cppuhelper/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-09 09:18:57 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-09 08:23:44 +0000
commitb3c72c734087b178cbcf1622e1088335c6eaf6a7 (patch)
treeb735935667d86b8e04e46509452abb91d9306a3e /cppuhelper/qa
parentfbda3f9a8d2d3f2ccd7999a3f110c56bce38c1d8 (diff)
cppuhelper: fix loplugin:cppunitassertequals warnings
Change-Id: Ia7c3de84b8001a30dbe1863be58a9639167cfa11 Reviewed-on: https://gerrit.libreoffice.org/28760 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'cppuhelper/qa')
-rw-r--r--cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx40
-rw-r--r--cppuhelper/qa/unourl/cppu_unourl.cxx4
2 files changed, 22 insertions, 22 deletions
diff --git a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
index 3190b7795db2..097ad9bf33a9 100644
--- a/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
+++ b/cppuhelper/qa/ifcontainer/cppu_ifcontainer.cxx
@@ -70,8 +70,8 @@ namespace cppu_ifcontainer
pContainer = new cppu::OInterfaceContainerHelper(m_aGuard);
- CPPUNIT_ASSERT_MESSAGE("Empty container not empty",
- pContainer->getLength() == 0);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Empty container not empty",
+ static_cast<sal_Int32>(0), pContainer->getLength());
int i;
for (i = 0; i < nTests; i++)
@@ -79,21 +79,21 @@ namespace cppu_ifcontainer
Reference<XEventListener> xRef = new ContainerListener(&aStats);
int nNewLen = pContainer->addInterface(xRef);
- CPPUNIT_ASSERT_MESSAGE("addition length mismatch",
- nNewLen == i + 1);
- CPPUNIT_ASSERT_MESSAGE("addition length mismatch",
- pContainer->getLength() == i + 1);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("addition length mismatch",
+ i + 1, nNewLen);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("addition length mismatch",
+ static_cast<sal_Int32>(i + 1), pContainer->getLength());
}
CPPUNIT_ASSERT_MESSAGE("alive count mismatch",
- aStats.m_nAlive == nTests);
+ bool(aStats.m_nAlive == nTests));
EventObject aObj;
pContainer->disposeAndClear(aObj);
CPPUNIT_ASSERT_MESSAGE("dispose count mismatch",
- aStats.m_nDisposed == nTests);
- CPPUNIT_ASSERT_MESSAGE("leaked container left alive",
- aStats.m_nAlive == 0);
+ bool(aStats.m_nDisposed == nTests));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("leaked container left alive",
+ 0, aStats.m_nAlive);
delete pContainer;
}
@@ -116,19 +116,19 @@ namespace cppu_ifcontainer
aElements = pContainer->getElements();
CPPUNIT_ASSERT_MESSAGE("query contents",
- (int)aElements.getLength() == nTests);
+ bool((int)aElements.getLength() == nTests));
if ((int)aElements.getLength() == nTests)
{
for (i = 0; i < nTests; i++)
{
CPPUNIT_ASSERT_MESSAGE("mismatching elements",
- aElements[i] == aListeners[i]);
+ bool(aElements[i] == aListeners[i]));
}
}
pContainer->clear();
- CPPUNIT_ASSERT_MESSAGE("non-empty container post clear",
- pContainer->getLength() == 0);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("non-empty container post clear",
+ static_cast<sal_Int32>(0), pContainer->getLength());
delete pContainer;
}
@@ -158,9 +158,9 @@ namespace cppu_ifcontainer
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
- CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 2);
- CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]);
- CPPUNIT_ASSERT_MESSAGE("match", aSeq[1] == xRefs[i*2+1]);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong num elements", static_cast<sal_Int32>(2), aSeq.getLength());
+ CPPUNIT_ASSERT_MESSAGE("match", bool(aSeq[0] == xRefs[i*2]));
+ CPPUNIT_ASSERT_MESSAGE("match", bool(aSeq[1] == xRefs[i*2+1]));
}
// remove every other interface
@@ -176,8 +176,8 @@ namespace cppu_ifcontainer
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
- CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 1);
- CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong num elements", static_cast<sal_Int32>(1), aSeq.getLength());
+ CPPUNIT_ASSERT_MESSAGE("match", bool(aSeq[0] == xRefs[i*2]));
}
// remove the 1st half of the rest
@@ -192,7 +192,7 @@ namespace cppu_ifcontainer
pHelper = pContainer->getContainer(pTypes[i]);
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
- CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 0);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("wrong num elements", static_cast<sal_Int32>(0), aSeq.getLength());
}
delete pContainer;
diff --git a/cppuhelper/qa/unourl/cppu_unourl.cxx b/cppuhelper/qa/unourl/cppu_unourl.cxx
index a54cf7cf40c9..de229cc91ea1 100644
--- a/cppuhelper/qa/unourl/cppu_unourl.cxx
+++ b/cppuhelper/qa/unourl/cppu_unourl.cxx
@@ -227,8 +227,8 @@ namespace cppu_unourl
{}
CPPUNIT_ASSERT_MESSAGE("Failed to parse URI", bValid);
- CPPUNIT_ASSERT_MESSAGE("Failed to detect parameter correctly",
- bPresent == aTests[i].bPresent);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Failed to detect parameter correctly",
+ aTests[i].bPresent, bPresent);
}
}