[Libreoffice-bugs] [Bug 139734] New: Drop redundant asserts after MacrosTest::loadFromDesktop

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Jan 18 09:22:00 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=139734

            Bug ID: 139734
           Summary: Drop redundant asserts after
                    MacrosTest::loadFromDesktop
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Keywords: difficultyBeginner, easyHack, skillCpp
          Severity: normal
          Priority: low
         Component: LibreOffice
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: mikekaganski at hotmail.com

In many unit tests (e.g., in dbaccess/qa/extras/empty-stdlib-save.cxx), we have
this pattern asserting on return value of MacrosTest::loadFromDesktop:

> uno::Reference<lang::XComponent> xComponent = loadFromDesktop(aFileName);
> CPPUNIT_ASSERT(xComponent.is());

MacrosTest::loadFromDesktop itself asserts on its return value (see [1]). Thus,
there additional checks in unit tests are redundant, and only create noise
unrelated to the tested functionality.

This easy hack is about finding all the places where the method is used, and
removing the direct assert on its return value if present.

[1]
https://opengrok.libreoffice.org/xref/core/unotest/source/cpp/macros_test.cxx?r=042033f1&mo=984&fi=39#39

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210118/b7501ba5/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list