rollbear / trompeloeil

Header only C++14 mocking framework
Boost Software License 1.0
802 stars 85 forks source link

Fix memory leak during expectation construction #334

Closed DNKpp closed 4 months ago

DNKpp commented 4 months ago

As discussed here https://github.com/rollbear/trompeloeil/pull/333 there exists a memory leak when creating expectations and a exception raises.

As its very hard to create a test for that, I use this PR and your the ci output as proof, that the issue is fixed. Hopefully its not too annoying. :)

See action run https://github.com/rollbear/trompeloeil/actions/runs/8680521953?pr=334 as a baseline, where I created a test to provoke the issue.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 83.33333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 34.87%. Comparing base (45583ab) to head (97f8167).

:exclamation: Current head 97f8167 differs from pull request most recent head 0c8e800. Consider uploading reports for the commit 0c8e800 to get more accurate results

Files Patch % Lines
include/trompeloeil/mock.hpp 83.33% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #334 +/- ## =========================================== - Coverage 99.31% 34.87% -64.44% =========================================== Files 12 10 -2 Lines 1022 906 -116 Branches 22 0 -22 =========================================== - Hits 1015 316 -699 - Misses 7 590 +583 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rollbear commented 4 months ago

Wow. That's impressive. Thank you!