Bug 96136 - replace CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL in basic's scanner test
Summary: replace CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL in basic's scanner test
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Dipankar Niranjan
URL:
Whiteboard: target:5.2.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2015-11-29 14:46 UTC by Markus Mohrhard
Modified: 2016-10-25 19:08 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Mohrhard 2015-11-29 14:46:42 UTC
Replace all possible CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL in the scanner test.

Don't replace places where a function call just returns a boolean. Instead do it for all places where we have a == inside of the CPPUNIT_ASSERT.

basic/qa/cppunit/test_scanner.cxx
Comment 1 David Tardon 2015-11-29 16:27:36 UTC
Note that if the expected value is a numeric literal, you MUST make sure it has the same type as the result (by using a suffix--e.g., 42u--or explicit cast--e.g., size_t(42)), otherwise it WILL fail to build on different platforms.
Comment 2 Robinson Tryon (qubit) 2015-12-10 11:41:03 UTC Comment hidden (obsolete)
Comment 3 Commit Notification 2016-01-04 11:41:58 UTC
Dipangar Niranjar committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0e41527fd52f676ff6240a08b3fe25607c1ca726

tdf#96136 replace CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Markus Mohrhard 2016-01-04 20:41:28 UTC
Great work. I'm looking forward to your next easy hack.
Comment 5 Robinson Tryon (qubit) 2016-02-18 16:37:20 UTC Comment hidden (obsolete)