Repository navigation
refactor(tests): extract fixed_point_test_helpers.h — fixed_point.cpp now under 1K LOC (closes #3130) (re-target of #3144) - #3164
Conversation
…rt of #3130) — closes the loop Seventh extraction in #3130. Moves all the test infrastructure templates into a shared header. With this PR, fixed_point.cpp drops to 613 LOC — under the meta 1K-LOC target. Together with PRs #3135, #3136, #3138, #3139, #3142, #3143, the original 5,230-LOC monolith is fully decomposed. Content moved (1053 LOC of helpers from 5 non-contiguous ranges): - test_*_impl<T> bit-exact helpers (original lines 131-585) - AccuracyResult struct + non-templated measure_* helpers + print_row helpers (original lines 838-1054) - measure_*_t<T> templated helpers + run_type_accuracy<T> (original lines 1120-1356) - test_bit_exact_equivalence<Tmpl, Conc> (original lines 1369-1430) - check_all_accuracy_bounds<T> regression gate (original lines 1456-1515) Same include pattern as fixed_point_bounds.h: each consumer .cpp file includes from WITHIN its anonymous namespace, after bounds.h. Tests pass: bash test fl_math_fixed_point --cpp (1/1, 0.37s test time, 117s build). fixed_point.cpp: 1,643 -> 613 LOC (under 1K target) fixed_point_test_helpers.h (new): 1053 LOC (header, no LOC cap) After this PR, fixed_point.cpp contains only: - includes + FL_TEST_FILE wrapper + namespace + raw_t + check_near + FP_TYPES macro + includes to bounds.h and test_helpers.h - Bit-exact test cases (CHECK_EQ-based) - Transcendental test cases (CHECK_CLOSE with bounds) - s16x16 accuracy report - multi-type accuracy report - fixed_point<N,M> vs sNxM bit-exact tests - per-type accuracy bounds tests - GitHub #2174 regression test - to_float comprehensive test Stacked on feat/3130-fixed-point-u8x24-u24x8-extract (PR #3143). Closes #3130 once all 7 stacked PRs merge. Meta tracking issue: #3127. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughExtracts all reusable fixed-point test helper code from ChangesFixed-point test helper extraction
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Re-opening of #3144. Closes #3130 — final extraction for fixed_point.cpp split.
Summary by CodeRabbit