Skip to content

refactor(tests): extract fixed_point_u4x12_u8x8.cpp (re-target of #3139) - #3161

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

zackees merged 1 commit into
masterfrom
feat/3130-fixed-point-u4x12-u8x8-extract

Conversation

@zackees

@zackees zackees commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

Re-opening of #3139. u4x12+u8x8 extraction. Part of #3130.

Summary by CodeRabbit

  • Tests
    • Reorganized fixed-point math test suite with improved architecture and coverage.
    • Enhanced testing for signed and unsigned fixed-point arithmetic operations, conversions, and transcendental functions.
    • Added regression validation for accuracy and edge-case handling.

…cpp (part of #3130)

Fourth extraction in #3130. Moves the u4x12 + u8x8 unsigned type tests
into their own file. Both share a section because they share the
file-local approx_equal() helper (used only within these two sections).

Content moved:
  - 28 FL_TEST_CASE u4x12 tests (construction, arithmetic, math ops,
    edge cases, precision, compound operations)
  - 60+ FL_TEST_CASE u8x8 tests (construction variants, addition/sub/
    mul/div, shifts, comparisons, math ops, sqrt/rsqrt/pow, edge cases)
  - approx_equal() static helper (lines 1644-1646 of original)

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

fixed_point.cpp: 4,277 -> 3,404 LOC
fixed_point_u4x12_u8x8.cpp (new): 896 LOC

Stacked on feat/3130-fixed-point-bounds-header (PR #3138). Predecessors:
  - feat/3130-fixed-point-misc-extract (PR #3135 — hook + misc)
  - feat/3130-fixed-point-constexpr-extract (PR #3136 — constexpr)
  - feat/3130-fixed-point-bounds-header (PR #3138 — bounds.h)

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

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit 8b9f734 into master Jun 16, 2026
4 checks passed
@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: cf033f13-387c-4c51-a10f-a96800ba33c1

📥 Commits

Reviewing files that changed from the base of the PR and between 158462c and 2287ae5.

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

📝 Walkthrough

Walkthrough

Removes 873 lines of legacy unsigned fixed-point tests (u4x12, u8x8, u12x4, u16x16, u8x24, u24x8) from tests/fl/math/fixed_point.cpp and relocates the u4x12/u8x8 coverage into a new dedicated file tests/fl/math/fixed_point_u4x12_u8x8.cpp with 896 lines of test cases.

Changes

Unsigned fixed-point test file split

Layer / File(s) Summary
Remove legacy unsigned tests
tests/fl/math/fixed_point.cpp
Deletes the trailing block of unsigned fixed-point tests and supporting helper code, leaving only the signed fixed-point architecture in place.
New u4x12 / u8x8 test suite
tests/fl/math/fixed_point_u4x12_u8x8.cpp
Adds a new translation unit with raw_t/approx_equal helpers and full FL_TEST_CASE coverage for u4x12 (construction, arithmetic, shifts, comparisons, math helpers) and u8x8 (same plus overflow/underflow, division-by-zero, and INT_BITS/FRAC_BITS trait assertions).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#3135: Modifies the same tests/fl/math/fixed_point.cpp by extracting overlapping fixed-point coverage (misc scalar/constexpr/pow tests) into a separate file, following the same split strategy as this PR.

Poem

🐇 Hop, hop, the tests have moved,
unsigned types in a new groove!
u4x12 and u8x8 found a home,
no longer in fixed_point they roam.
The warren's tidy, clean, and bright —
each test file snug and right! 🌟

✨ 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-u4x12-u8x8-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: Done

Development

Successfully merging this pull request may close these issues.

1 participant