dunst-project / dunst

Lightweight and customizable notification daemon
https://dunst-project.org
Other
4.42k stars 338 forks source link

Add tests for NotificationListHistory #1274

Closed zappolowski closed 4 months ago

zappolowski commented 5 months ago

... and while at it also fix all memory leaks from this method.

codecov-commenter commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (8196755) 64.48% compared to head (9a54a70) 65.22%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1274 +/- ## ========================================== + Coverage 64.48% 65.22% +0.74% ========================================== Files 48 48 Lines 7918 7952 +34 ========================================== + Hits 5106 5187 +81 + Misses 2812 2765 -47 ``` | [Flag](https://app.codecov.io/gh/dunst-project/dunst/pull/1274/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dunst-project) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/dunst-project/dunst/pull/1274/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dunst-project) | `65.22% <100.00%> (+0.74%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dunst-project#carryforward-flags-in-the-pull-request-comment) to find out more.

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

fwsmit commented 5 months ago

Could you explain the memory leak?

zappolowski commented 5 months ago

From what I've seen it comes from g_variant_new_from_bytes (which is not necessary here and can be avoided by using typed versions like I did) and g_variant_type_new, which even states, that it transfers ownership and thus should be freed.

zappolowski commented 5 months ago

I've added some minor clean up:

PS: I cannot reproduce the pipeline failure. That image ran successfully on my machine. Pushed again without changes ... now it works.

@fwsmit If you agree with this, I'd like to include the fixup into the first commit before merging.

bynect commented 4 months ago

looks good. Are you done with the changes or something is still pending?

Also friso is away at the moment