Skip to content

refactor(tests): extract fixed_point_u8x24_u24x8.cpp (re-target of #3143) - #3163

Merged
zackees merged 1 commit into
masterfrom
feat/3130-fixed-point-u8x24-u24x8-extract
Jun 16, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/3130-fixed-point-u8x24-u24x8-extract

Conversation

@zackees

@zackees zackees commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

Re-opening of #3143. Part of #3130.

Summary by CodeRabbit

  • Tests
    • Reorganized fixed-point arithmetic tests into a dedicated file for improved code organization and maintainability.

….cpp (part of #3130)

Sixth extraction in #3130. Moves the u8x24 + u24x8 unsigned type tests
into their own file.

Content moved:
  - ~12 FL_TEST_CASE u8x24 tests (construction, addition, sub, mul, div,
    scalar mul, shifts, comparisons, math functions, sqrt/rsqrt/pow,
    edge cases, complex expressions)
  - ~25 FL_TEST_CASE u24x8 tests (default/float/from_raw construction,
    arithmetic, comparisons, mixed arithmetic, to_float, sqrt/rsqrt/pow,
    sqrt identity, floor/ceil/fract, abs, min/max/mod, lerp/clamp/step/
    smoothstep, edge values, large value arithmetic)

Tests pass: bash test fl_math_fixed_point --cpp (1/1, 0.34s test time,
56s build).

fixed_point.cpp: 2,492 -> 1,643 LOC
fixed_point_u8x24_u24x8.cpp (new): 872 LOC

Stacked on feat/3130-fixed-point-u12x4-u16x16-extract (PR #3142).

Part of #3130. Meta tracking issue: #3127.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit 7143f60 into master Jun 16, 2026
4 checks passed
@zackees
zackees deleted the feat/3130-fixed-point-u8x24-u24x8-extract branch June 16, 2026 04:43
@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bb5f726a-fcb0-4ae5-84fc-c52ed5309fd3

📥 Commits

Reviewing files that changed from the base of the PR and between 7f1eb64 and e784b5b.

📒 Files selected for processing (2)
  • tests/fl/math/fixed_point.cpp
  • tests/fl/math/fixed_point_u8x24_u24x8.cpp

📝 Walkthrough

Walkthrough

Moves the u8x24 and u24x8 FL_TEST_CASE blocks (approximately 849 lines) out of tests/fl/math/fixed_point.cpp and into a new dedicated translation unit tests/fl/math/fixed_point_u8x24_u24x8.cpp (872 lines), with no changes to the tested logic or assertions.

Changes

Fixed-point test file extraction

Layer / File(s) Summary
Remove legacy tests from monolithic file
tests/fl/math/fixed_point.cpp
Deletes all trailing FL_TEST_CASE blocks for u8x24 and u24x8; file now ends after the to_float() comprehensive conversion test.
New dedicated test translation unit
tests/fl/math/fixed_point_u8x24_u24x8.cpp
Introduces the new file with headers, anonymous namespace, full u8x24 coverage (construction, arithmetic including underflow wrap, shifts, comparisons, math functions, edge cases, compound expressions), full u24x8 coverage (construction, conversions, arithmetic, scalar multiply/divide, shifts, comparisons, sqrt/rsqrt/pow, interpolation/clamp/step/smoothstep family, identity and edge invariants), and the closing namespace and FL_TEST_FILE wrapper.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2972: Directly touches the same u8x24/u24x8 fixed-point pow near-1.0 boundary test cases that are being relocated by this PR.

Poem

🐇 Hop, hop, the tests have moved!
From one big file to a fresh new grove,
u8x24 and u24x8 now reside
In their own cozy .cpp abode.
The math still checks, the assertions hold—
A tidy warren, neatly scrolled! 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/3130-fixed-point-u8x24-u24x8-extract

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant