fix: iterator/stat utility edge cases and add tests - #5308
ReenigneArcher merged 3 commits into
Conversation
There was a problem hiding this comment.
This is awesome! Always glad to have more tests added!
Looks pretty good, but could you fix the sonar reported sonar issues as well as adjust the style of the comments mentioned below.
Also, please update the PR to use the correct template. You can find it at https://github.com/LizardByte/.github/blob/master/.github/pull_request_template.md?plain=1
6da22e1 to
c53fb9c
Compare
9a036b8 to
68bfcfa
Compare
Corrected core logic in `round_robin`, `stat_trackers`, and `utility`: round-robin equality now compares iterator position (not dereferenced value), ordering support was added, and the iterator is constrained to random-access types; `min_max_avg_tracker` now initializes max with `lowest()` to handle negative values correctly; and hex conversion now safely handles empty ranges. Tests were broadly reorganized and tightened to match include/style conventions and to cover the behavior changes, including duplicate-value iterator comparisons, ordering semantics, negative stat tracking, and empty hex-vector handling.
68bfcfa to
bf5b5c2
Compare
Bundle ReportBundle size has no change ✅ |
0021a3d to
1ae76a1
Compare
|
|
Thanks for the PR! While reviewing the changes I discovered some edge cases in the src code that needed to be fixed, so the tests are already proving to be useful. I've pushed additional changes to this PR to address those edge cases, as well as a small style change for the tests. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5308 +/- ##
==========================================
+ Coverage 35.12% 35.63% +0.50%
==========================================
Files 104 104
Lines 25406 25508 +102
Branches 11211 11240 +29
==========================================
+ Hits 8925 9090 +165
+ Misses 13543 13419 -124
- Partials 2938 2999 +61
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 25 files with indirect coverage changes Continue to review full report in Codecov by Harness.
|
Screenshot ComparisonPR #5308 screenshots vs Matrix:
|


































































Description
This PR fixes correctness and safety issues discovered while expanding unit coverage for the round-robin iterator, statistics tracker, and utility helpers.
std::numeric_limits<T>::lowest(), allowing negative floating-point samples to be tracked correctly.hex_vec()without decrementing an invalid end iterator.Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.