From 6b00d0576a310796590631d14c54d7d5ea6814ac Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 8 Feb 2021 07:48:59 +0100 Subject: Improve loplugin:cppunitassertequal for CPPUNIT_ASSERT(a && b) ...by re-enabling the code temporarily #if'ed-out in a528392e71bc70136021be4e3d83732fccbb885e "Fixed/improved loplugin:cppunitassertequals" (and which then triggers lots of other lopglugin:cppunitassertequal CPPUNIT_ASSERT -> CPPUNIT_ASSERT_EQUAL warnings). For two css::uno::Reference equality comparisons in cppu/qa/test_any.cxx, it was more straightforward to rewrite them with an explicit call to operator == (which silences loplugin:cppunitassertequal) than to adapt them to CPPUNIT_ASSERT_EQUAL's requirement for arguments of identical types. In sc/qa/unit/ucalc_pivottable.cxx, ScDPItemData needs toString, which has been implemented trivially for now, but might want to combine that with the DEBUG_PIVOT_TABLE-only ScDPItemData::Dump. Change-Id: Iae6d09cf69bd4e52fe4411bba9e50c48e696291c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110546 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sot/qa/cppunit/test_sot.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sot') diff --git a/sot/qa/cppunit/test_sot.cxx b/sot/qa/cppunit/test_sot.cxx index 592a7a1cf0f5..ce8b7c8c8307 100644 --- a/sot/qa/cppunit/test_sot.cxx +++ b/sot/qa/cppunit/test_sot.cxx @@ -145,10 +145,14 @@ namespace SvFileStream aStream(aURL, StreamMode::READ); tools::SvRef xObjStor = new SotStorage(aStream); CPPUNIT_ASSERT_MESSAGE("sot storage failed to open", - xObjStor.is() && !xObjStor->GetError()); + xObjStor.is()); + CPPUNIT_ASSERT_MESSAGE("sot storage failed to open", + !xObjStor->GetError()); tools::SvRef xStream = xObjStor->OpenSotStream("Book"); CPPUNIT_ASSERT_MESSAGE("stream failed to open", - xStream.is() && !xObjStor->GetError()); + xStream.is()); + CPPUNIT_ASSERT_MESSAGE("stream failed to open", + !xObjStor->GetError()); CPPUNIT_ASSERT_MESSAGE("error in opened stream", !xStream->GetError()); sal_uLong nPos = xStream->GetSize(); CPPUNIT_ASSERT_EQUAL_MESSAGE("odd stream length", static_cast(13312), nPos); -- cgit