From 40f0ae88bc6b6964389073aba62b6af8d55982e5 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 2 Sep 2016 09:15:55 +0200 Subject: dbaccess: fix loplugin:cppunitassertequals warnings Change-Id: Ia450aa3170a21424fce641d3c8dee43b49f8ef61 Reviewed-on: https://gerrit.libreoffice.org/28609 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- dbaccess/qa/extras/rowsetclones.cxx | 30 +++++++++++++++--------------- dbaccess/qa/unit/firebird.cxx | 10 +++++----- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'dbaccess/qa') 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(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(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(1), xResultSet->getRow()); + CPPUNIT_ASSERT_EQUAL(static_cast(1), xResultSetClone->getRow()); + CPPUNIT_ASSERT_EQUAL(static_cast(1), xRow->getInt(1)); + CPPUNIT_ASSERT_EQUAL(static_cast(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(2), xResultSet->getRow()); + CPPUNIT_ASSERT_EQUAL(static_cast(1), xResultSetClone->getRow()); + CPPUNIT_ASSERT_EQUAL(static_cast(2), xRow->getInt(1)); + CPPUNIT_ASSERT_EQUAL(static_cast(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(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(2), xResultSetClone->getRow()); + CPPUNIT_ASSERT_EQUAL(static_cast(2), xRowClone->getInt(1)); + CPPUNIT_ASSERT_EQUAL(static_cast(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(1), xRow->getInt(1)); closeDocument(uno::Reference(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 -- cgit