skupperproject / skupper-router

An application-layer router for Skupper networks
https://skupper.io
Apache License 2.0
14 stars 18 forks source link

Fixes #1536: Replace unnecessary check for `n >= 0` with assertion that `n` is `unsigned long` #1539

Closed jiridanek closed 2 weeks ago

jiridanek commented 2 weeks ago

Alternate fix to

I saw that Coverity warning a long time ago already, but I always felt unsure about depending on a variable being of a certain type. Here's a solution that should pass Coverity and it still ensures that n is not negative.

Do with it as you will.

Fixes #1536

jiridanek commented 2 weeks ago

over all, maybe I do like the fix of just removing the check better... anyways, yeah, I won't be overthinking this any more

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 62.7%. Comparing base (1b1d4b9) to head (e54fd44). Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1539 +/- ## ======================================= - Coverage 63.0% 62.7% -0.4% ======================================= Files 214 217 +3 Lines 51857 52684 +827 Branches 5986 6071 +85 ======================================= + Hits 32681 33037 +356 - Misses 16966 17409 +443 - Partials 2210 2238 +28 ``` | [Flag](https://app.codecov.io/gh/skupperproject/skupper-router/pull/1539/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=skupperproject) | Coverage Δ | | |---|---|---| | [pysystemtests](https://app.codecov.io/gh/skupperproject/skupper-router/pull/1539/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=skupperproject) | `77.5% <ø> (-0.8%)` | :arrow_down: | | [systemtests](https://app.codecov.io/gh/skupperproject/skupper-router/pull/1539/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=skupperproject) | `56.0% <50.0%> (-0.2%)` | :arrow_down: | 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=skupperproject#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/skupperproject/skupper-router/pull/1539/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=skupperproject) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/skupperproject/skupper-router/pull/1539/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=skupperproject) | `62.7% <40.0%> (-0.4%)` | :arrow_down: | | [systemtests](https://app.codecov.io/gh/skupperproject/skupper-router/pull/1539/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=skupperproject) | `62.7% <40.0%> (-0.4%)` | :arrow_down: |