| Summary: | CPP unit tests: provide message converters to allow use of O(U)Strings as _MESSAGE argument | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Mike Kaganski <mikekaganski> |
| Component: | LibreOffice | Assignee: | Not Assigned <libreoffice-bugs> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | normal | CC: | buzea.bogdan, mentoring, sberg.fun |
| Priority: | medium | Keywords: | difficultyBeginner, easyHack, skillCpp |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Crash report or crash signature: | Regression By: | ||
| Bug Depends on: | |||
| Bug Blocks: | 143781 | ||
|
Description
Mike Kaganski
2023-04-11 13:11:02 UTC
As I mentioned in the comment at <https://gerrit.libreoffice.org/c/core/+/152890/2#message-58b2d9892b4fef4e398ed269aa971494ffe1f33d> "tdf#154757 Provide O(U)String converters for _MESSAGE arguments": "I think the main issue here is that as soon as you need a CPPUNIT_ASSERT_MESSAGE with a programmatically assembled message, your test is doing something wrong anyway. :) Test code should be as straightforward to understand and to debug for humans as possible. Tempting as it may be, it ideally should not contain [e.g.] any loops over data to test, it should rather spell out those individual tests explicitly. Probably each of us occasionally is a sinner in this respect when writing tests, but my argument against such improvements for the CPPUNIT_ASSERT_MESSAGE's message argument is always the same: If you need it, it would be better to restructure the test code (or, failing that, to bite the bullet and have some explicit call to OUString::getStr or similar, in the 'bad' test code)." |