Closed adamkewley closed 4 months ago
Looks like the unique_ptr
refactor may have created a segfault in the mac tests (e.g. the test suite was assuming the previously-leaked pointers were retained or similar)
I'll have to rerun this with libASAN to figure out where the assumption breaks.
The same segfault appears to also be on the main
branch if i'm analyzing this test suite with libASAN O_o
The segfault that libASAN was detecting was because a loop in testComponents
doesn't (and didn't) bounds-check access to a component list iterator.
(this doesn't necessarily mean that it's the bug in MacOS, but hopefully it is)
Should be ok to go now (unless there's a desire to also run it through MacOS's libASAN, but I don't imagine it's necessary for a test suite refactor)
Heavily refactors
OpenSim/Tests/Components/testComponents.cpp
to:Brief summary of changes
Catch2
withDYNAMIC_SECTION
, so that particular component failures are clearly labelled in the test logOpenSim::log_info
andOpenSim::log_warn
, rather thanstd::cout
for logging, so that the messages are easier to readComponentTestCases
, so there's one central place for controlling component lifetime, which components are tested, etc. (#3694 essentially needs this if I can't rewrite the tests to correctly build transient socket dependencies)Component&
rather thanComponent*
(the pointer was never rewritten or nullchecked, so a reference is preferable)new
s tostd::unique_ptr
, where it makes senseTesting I've completed
Looking for feedback on...
CHANGELOG.md (choose one)
This change is![Reviewable](https://reviewable.io/review_button.svg)