False positive code smells for cppunit test machinery

I am getting false positives for “make this function const” when using cppuit from rule cpp:S5817.

For example:

#include <cppunit/extensions/HelperMacros.h>

class FooTest: public CppUnit::TestFixture
{
   CPPUNIT_TEST_SUITE(FooTest);

   CPPUNIT_TEST(testConstructor1);
   
   CPPUNIT_TEST_SUITE_END();
public:
   /// @name Housekeeping
   /// @{

   FooTest();

   /// @}
public:
   /// @name Tests
   /// @{

   void testConstructor1(); //sonar wants me to be const but cppunit does not

  ///@}
};

The cppunit machinery requires the member functions to be non-const or it can’t find them.

Also is there a way to mark several issues at once as “won’t fix”. I cannot find a “bulk change” button or select multiple issues at once using ctrl or shift.

I found it. It is just not visible from the code view.

However there is a problem. The filters for “open” issues or “unresolved” issues do not seem to remove them from the list. Note this is using firefox 91.7.1esr on windows:

About your initial issue, I created a ticket CPP-3634 to detect this kind of situation. About the user experience issue you have, I’ll let someone else answer you.

Hey there.

We had a major reindexing of issues over the weekend – do you still face an issue on filtering?

Yes there is still an issue with filtering. For example in the screen shot below
I have issues marked resolved and confirmed which do not match the “unresolved” and “open” filters for status and resolution.

Hi @KantarBruceAdams

I’m very sorry for the late reply.
I reproduced the behavior you observed on issues filters and raised an internal ticket.

Regards,
Claire

Update March 8th, 2023:
The issue is now fixed.

Great! :grinning: Presumably it works in some situations or you would have had more reports.

Regards,

Bruce.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.