Skip to content

test(unit): add tests for utility, round_robin, and stat_trackers#5308

Open
dasepmoch wants to merge 1 commit into
LizardByte:masterfrom
dasepmoch:test/add-utility-round-robin-stat-trackers-tests
Open

test(unit): add tests for utility, round_robin, and stat_trackers#5308
dasepmoch wants to merge 1 commit into
LizardByte:masterfrom
dasepmoch:test/add-utility-round-robin-stat-trackers-tests

Conversation

@dasepmoch

Copy link
Copy Markdown

Description

Add unit tests for three modules that currently have no test coverage:

  • src/utility.h — Hex conversion (util::hex, hex_vec, from_hex, from_hex_vec), string parsing (from_chars, from_view), Either type, FailGuard, buffer_t, append_struct, endian helpers, and log_hex.
  • src/round_robin.h — Round-robin iterator wrap-around, arithmetic operators, comparisons, edge cases (single element, multiple cycles), and arrow operator with structs.
  • src/stat_trackers.h/.cpp — Format helpers (one_digit_after_decimal, two_digits_after_decimal), min_max_avg_tracker callback timing, min/max/avg calculation correctness, reset behavior, and double type support.

These are pure-logic, header-only (or minimal .cpp) modules with zero external dependencies, making them ideal candidates for improving test coverage without needing GPU or platform-specific hardware.

Related Issues / Discussions

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Dependency update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code where necessary
  • My changes generate no new warnings
  • New tests have been added that prove my fix is effective or that my feature works
  • I have verified my changes locally (CI will verify on push)

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
25 New issues
25 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

1 participant