opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
759 stars 308 forks source link

Refactor testComponents.cpp to use Catch and logging interface #3695

Closed adamkewley closed 4 months ago

adamkewley commented 5 months ago

Heavily refactors OpenSim/Tests/Components/testComponents.cpp to:

Brief summary of changes

Testing I've completed

Looking for feedback on...

CHANGELOG.md (choose one)


This change is Reviewable

adamkewley commented 5 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.

adamkewley commented 4 months ago

The same segfault appears to also be on the main branch if i'm analyzing this test suite with libASAN O_o

adamkewley commented 4 months ago

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)

adamkewley commented 4 months ago

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)