Kaydet (Commit) ff8f5e62 authored tarafından Miklos Vajna's avatar Miklos Vajna

writerperfect, xmloff: fix loplugin:cppunitassertequals warnings

Change-Id: Ie8246433a7cea0886f00d8c76cf6f7d023545417
Reviewed-on: https://gerrit.libreoffice.org/32770Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 032b5090
......@@ -139,7 +139,7 @@ void lcl_testDataOperations(RVNGInputStream &rStream)
CPPUNIT_ASSERT_EQUAL(-1, rStream.seek(0, librevenge::RVNG_SEEK_CUR));
unsigned long numBytesRead = 0;
CPPUNIT_ASSERT(nullptr == rStream.read(1, numBytesRead));
CPPUNIT_ASSERT(!rStream.read(1, numBytesRead));
CPPUNIT_ASSERT_EQUAL(0UL, numBytesRead);
}
......
......@@ -197,7 +197,7 @@ void WPXSvStreamTest::testSeekSet()
CPPUNIT_ASSERT(!pInput->isEnd());
CPPUNIT_ASSERT_EQUAL(0, pInput->seek(nLen, RVNG_SEEK_SET));
CPPUNIT_ASSERT(nLen == pInput->tell());
CPPUNIT_ASSERT_EQUAL(pInput->tell(), nLen);
CPPUNIT_ASSERT(pInput->isEnd());
// go back to the beginning
......@@ -212,7 +212,7 @@ void WPXSvStreamTest::testSeekSet()
CPPUNIT_ASSERT(!pInput->isEnd());
CPPUNIT_ASSERT(0 != pInput->seek(nLen + 1, RVNG_SEEK_SET));
CPPUNIT_ASSERT(nLen == pInput->tell());
CPPUNIT_ASSERT_EQUAL(pInput->tell(), nLen);
CPPUNIT_ASSERT(pInput->isEnd());
}
......@@ -249,7 +249,7 @@ void WPXSvStreamTest::testSeekCur()
CPPUNIT_ASSERT(!pInput->isEnd());
CPPUNIT_ASSERT(0 != pInput->seek(nLen + 1, RVNG_SEEK_CUR));
CPPUNIT_ASSERT(nLen == pInput->tell());
CPPUNIT_ASSERT_EQUAL(pInput->tell(), nLen);
CPPUNIT_ASSERT(pInput->isEnd());
}
......@@ -264,11 +264,11 @@ void WPXSvStreamTest::testSeekEnd()
// valid seeks
CPPUNIT_ASSERT_EQUAL(0, pInput->seek(0, RVNG_SEEK_END));
CPPUNIT_ASSERT(nLen == pInput->tell());
CPPUNIT_ASSERT_EQUAL(pInput->tell(), nLen);
CPPUNIT_ASSERT(pInput->isEnd());
CPPUNIT_ASSERT_EQUAL(0, pInput->seek(-1, RVNG_SEEK_END));
CPPUNIT_ASSERT((nLen - 1) == pInput->tell());
CPPUNIT_ASSERT_EQUAL(pInput->tell(), (nLen - 1));
CPPUNIT_ASSERT(!pInput->isEnd());
CPPUNIT_ASSERT_EQUAL(0, pInput->seek(-nLen, RVNG_SEEK_END));
......@@ -281,7 +281,7 @@ void WPXSvStreamTest::testSeekEnd()
// invalid seeks
CPPUNIT_ASSERT(0 != pInput->seek(1, RVNG_SEEK_END));
CPPUNIT_ASSERT(nLen == pInput->tell());
CPPUNIT_ASSERT_EQUAL(pInput->tell(), nLen);
CPPUNIT_ASSERT(pInput->isEnd());
CPPUNIT_ASSERT(0 != pInput->seek(-nLen - 1, RVNG_SEEK_END));
......@@ -297,7 +297,7 @@ void WPXSvStreamTest::testStructured()
assert(bool(pInput));
CPPUNIT_ASSERT(pInput->isStructured());
CPPUNIT_ASSERT(2 == pInput->subStreamCount());
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned>(2), pInput->subStreamCount());
lcl_testSubStreams(pInput);
// check for existing substream
......@@ -318,7 +318,7 @@ void WPXSvStreamTest::testStructured()
assert(bool(pInput));
CPPUNIT_ASSERT(pInput->isStructured());
CPPUNIT_ASSERT(9 == pInput->subStreamCount());
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned>(9), pInput->subStreamCount());
lcl_testSubStreams(pInput);
// check for existing substream
......@@ -338,11 +338,11 @@ void WPXSvStreamTest::testStructured()
const shared_ptr<RVNGInputStream> pInput(lcl_createStream());
CPPUNIT_ASSERT(!pInput->isStructured());
CPPUNIT_ASSERT(0 == pInput->subStreamCount());
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned>(0), pInput->subStreamCount());
CPPUNIT_ASSERT(!pInput->existsSubStream("foo"));
CPPUNIT_ASSERT(nullptr == pInput->getSubStreamByName("foo"));
CPPUNIT_ASSERT(nullptr == pInput->getSubStreamById(42));
CPPUNIT_ASSERT(nullptr == pInput->subStreamName(42));
CPPUNIT_ASSERT(!pInput->getSubStreamByName("foo"));
CPPUNIT_ASSERT(!pInput->getSubStreamById(42));
CPPUNIT_ASSERT(!pInput->subStreamName(42));
}
}
......
......@@ -78,13 +78,13 @@ void Test::testAutoStylePool()
// not that interesting but worth checking
bool bHack = (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr);
if (bHack)
CPPUNIT_ASSERT_MESSAGE( "style / naming changed", aName == "Bob" );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "style / naming changed", OUString("Bob"), aName );
else
CPPUNIT_ASSERT_MESSAGE( "style / naming changed", aName == "Bob1" );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "style / naming changed", OUString("Bob1"), aName );
// find ourselves again:
OUString aSameName = xPool->Find( XML_STYLE_FAMILY_TEXT_PARAGRAPH, "", aProperties );
CPPUNIT_ASSERT_MESSAGE( "same style not found", aSameName == aName );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "same style not found", aName, aSameName );
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment