iptux-src / iptux

A software for sharing in LAN
GNU General Public License v2.0
432 stars 128 forks source link

Don't open url/path in unittest, only log it #613

Closed lidaobing closed 2 weeks ago

lidaobing commented 2 weeks ago

Summary by Sourcery

Introduced a mechanism to disable URL opening in tests by adding a toggle function and updating the test cases to use this function.

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This pull request introduces a mechanism to toggle the opening of URLs in tests. It adds a new atomic boolean flag open_url_enabled to control whether URLs should be opened or just logged. This change is implemented in the iptux_open_path and iptux_open_url functions. Additionally, a new function _ForTestToggleOpenUrl is added to enable or disable this feature. The test file ApplicationTest.cpp is updated to use this new function.

File-Level Changes

Files Changes
src/iptux/UiHelper.cpp
src/iptux/UiHelper.h
Introduced a new mechanism to toggle URL opening using an atomic boolean and a helper function.
src/iptux/ApplicationTest.cpp Updated tests to use the new URL opening toggle function.

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Project coverage is 51.45%. Comparing base (02958ea) to head (38d009b).

Files Patch % Lines
src/iptux/UiHelper.cpp 77.77% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #613 +/- ## ========================================== - Coverage 51.47% 51.45% -0.02% ========================================== Files 64 64 Lines 8354 8361 +7 ========================================== + Hits 4300 4302 +2 - Misses 4054 4059 +5 ```

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