https://bugs.documentfoundation.org/show_bug.cgi?id=98264
Bug ID: 98264
Summary: use correct cppunit assert macros in calc's unit test
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Calc
Assignee: [email protected]
Reporter: [email protected]
Created attachment 123065
--> https://bugs.documentfoundation.org/attachment.cgi?id=123065&action=edit
file containting the clang plugin output
Currently many places in sc/qa/unit/ucalc* use CPPUNIT_ASSERT instead of
CPPUNIT_ASSERT_EQUAL or CPPUNIT_ASSERT_DOUBLES_EQUAL. Therefore if one of these
checks fails during the test run we are not seeing the expected and the actual
value.
The task is to replace the places of CPPUNIT_ASSERT that contain a operator==
check with CPPUNIT_ASSERT_EQUAL. There are two small problems that make the
task a bit more challenging: both parameters to CPPUNIT_ASSERT_EQUAL need to be
of the same type so you might need to cast one of the types especially if it is
an integral type.
e.g CPPUNIT_ASSERT_EQUAL(size_t(3), aVector.size());
Additionally you should not use CPPUNIT_ASSERT_EQUAL with float or double
values. So if one of the types is a double you should use ASSERT_DOUBLES_EQUAL
instead.
The attached file contains all places that our clang compiler plugin found
where CPPUNIT_ASSERT is used together with operator==.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs