Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for NotificationListHistory #1274

Conversation

zappolowski
Copy link
Member

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

@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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

Additional details and impacted files
@@            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 Coverage Δ
unittests 65.22% <100.00%> (+0.74%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fwsmit
Copy link
Member

fwsmit commented Jan 30, 2024

Could you explain the memory leak?

@zappolowski
Copy link
Member Author

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
Copy link
Member Author

zappolowski commented Feb 2, 2024

I've added some minor clean up:

  • avoid heap allocation of the outer builder - just leave it on the stack as management is easier this way
  • inline answer just for conciseness - g_dbus_method_invocation_return_value takes care of the floating variant created by g_variant_new already

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.

@zappolowski zappolowski force-pushed the add-tests-for-notification-list branch from c33a48d to b8f6484 Compare February 2, 2024 16:32
@zappolowski zappolowski force-pushed the add-tests-for-notification-list branch 2 times, most recently from 76761f6 to 9a54a70 Compare February 19, 2024 05:13
@bynect
Copy link
Member

bynect commented Feb 29, 2024

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

Also friso is away at the moment

... and while at it also fix all memory leaks.
@zappolowski zappolowski force-pushed the add-tests-for-notification-list branch from 9a54a70 to a67db1c Compare March 1, 2024 09:49
@zappolowski zappolowski merged commit 660e8ba into dunst-project:master Mar 1, 2024
18 checks passed
@zappolowski zappolowski deleted the add-tests-for-notification-list branch March 1, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants