summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-02 09:15:55 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-02 08:31:27 +0000
commit40f0ae88bc6b6964389073aba62b6af8d55982e5 (patch)
tree5f5d987e137fb364e35d0778171a0832f2bd8a22
parentf352ee156c1f184b3aded8dc0ea3eeb68bfbca10 (diff)
dbaccess: fix loplugin:cppunitassertequals warnings
Change-Id: Ia450aa3170a21424fce641d3c8dee43b49f8ef61 Reviewed-on: https://gerrit.libreoffice.org/28609 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--dbaccess/qa/extras/rowsetclones.cxx30
-rw-r--r--dbaccess/qa/unit/firebird.cxx10
2 files changed, 20 insertions, 20 deletions
diff --git a/dbaccess/qa/extras/rowsetclones.cxx b/dbaccess/qa/extras/rowsetclones.cxx
index 2ae55ccdf263..28ea38f2bd38 100644
--- a/dbaccess/qa/extras/rowsetclones.cxx
+++ b/dbaccess/qa/extras/rowsetclones.cxx
@@ -89,11 +89,11 @@ void RowSetClones::test()
CPPUNIT_ASSERT(xResultSet->isBeforeFirst());
CPPUNIT_ASSERT(xResultSet->next());
CPPUNIT_ASSERT(xResultSet->isFirst());
- CPPUNIT_ASSERT(xResultSet->getRow() == 1);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xResultSet->getRow());
uno::Reference< XRow > xRow(xResultSet, UNO_QUERY);
CPPUNIT_ASSERT(xRow.is());
- CPPUNIT_ASSERT(xRow->getInt(1) == 1);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xRow->getInt(1));
uno::Reference< XResultSetAccess > xResultSetAccess(xResultSet, UNO_QUERY);
CPPUNIT_ASSERT(xResultSetAccess.is());
@@ -107,36 +107,36 @@ void RowSetClones::test()
// and does not move its source.
CPPUNIT_ASSERT(xResultSetClone->isFirst());
CPPUNIT_ASSERT(xResultSet->isFirst());
- CPPUNIT_ASSERT(xResultSet->getRow() == 1);
- CPPUNIT_ASSERT(xResultSetClone->getRow() == 1);
- CPPUNIT_ASSERT(xRow->getInt(1) == 1);
- CPPUNIT_ASSERT(xRowClone->getInt(1) == 1);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xResultSet->getRow());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xResultSetClone->getRow());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xRow->getInt(1));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xRowClone->getInt(1));
// if we move the source, the clone does not move
CPPUNIT_ASSERT(xResultSet->next());
CPPUNIT_ASSERT(xResultSetClone->isFirst());
- CPPUNIT_ASSERT(xResultSet->getRow() == 2);
- CPPUNIT_ASSERT(xResultSetClone->getRow() == 1);
- CPPUNIT_ASSERT(xRow->getInt(1) == 2);
- CPPUNIT_ASSERT(xRowClone->getInt(1) == 1);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xResultSet->getRow());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xResultSetClone->getRow());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xRow->getInt(1));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xRowClone->getInt(1));
CPPUNIT_ASSERT(xResultSet->last());
CPPUNIT_ASSERT(xResultSet->isLast());
CPPUNIT_ASSERT(xResultSetClone->isFirst());
- CPPUNIT_ASSERT(xRowClone->getInt(1) == 1);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xRowClone->getInt(1));
// and the other way round
CPPUNIT_ASSERT(xResultSet->first());
CPPUNIT_ASSERT(xResultSetClone->next());
CPPUNIT_ASSERT(xResultSet->isFirst());
- CPPUNIT_ASSERT(xResultSetClone->getRow() == 2);
- CPPUNIT_ASSERT(xRowClone->getInt(1) == 2);
- CPPUNIT_ASSERT(xRow->getInt(1) == 1);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xResultSetClone->getRow());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xRowClone->getInt(1));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xRow->getInt(1));
CPPUNIT_ASSERT(xResultSetClone->last());
CPPUNIT_ASSERT(xResultSetClone->isLast());
CPPUNIT_ASSERT(xResultSet->isFirst());
- CPPUNIT_ASSERT(xRow->getInt(1) == 1);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xRow->getInt(1));
closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY));
}
diff --git a/dbaccess/qa/unit/firebird.cxx b/dbaccess/qa/unit/firebird.cxx
index da0bed760d2e..e031e16a3494 100644
--- a/dbaccess/qa/unit/firebird.cxx
+++ b/dbaccess/qa/unit/firebird.cxx
@@ -88,15 +88,15 @@ void FirebirdTest::testIntegerDatabase()
uno::Reference< XColumnLocate > xColumnLocate(xRow, UNO_QUERY);
CPPUNIT_ASSERT(xColumnLocate.is());
- CPPUNIT_ASSERT(sal_Int16(-30000) ==
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(-30000),
xRow->getShort(xColumnLocate->findColumn("_SMALLINT")));
- CPPUNIT_ASSERT(sal_Int32(-2100000000) ==
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-2100000000),
xRow->getInt(xColumnLocate->findColumn("_INT")));
- CPPUNIT_ASSERT(SAL_CONST_INT64(-9000000000000000000) ==
+ CPPUNIT_ASSERT_EQUAL(SAL_CONST_INT64(-9000000000000000000),
xRow->getLong(xColumnLocate->findColumn("_BIGINT")));
- CPPUNIT_ASSERT("5" ==
+ CPPUNIT_ASSERT_EQUAL(OUString("5"),
xRow->getString(xColumnLocate->findColumn("_CHAR")));
- CPPUNIT_ASSERT("5" ==
+ CPPUNIT_ASSERT_EQUAL(OUString("5"),
xRow->getString(xColumnLocate->findColumn("_VARCHAR")));
CPPUNIT_ASSERT(!xResultSet->next()); // Should only be one row