Skip to content

Add configurable precision for complex stringification - #3203

Open
fzlzjerry wants to merge 1 commit into
catchorg:develfrom
fzlzjerry:feat/2876-complex-stringmaker
Open

Add configurable precision for complex stringification#3203
fzlzjerry wants to merge 1 commit into
catchorg:develfrom
fzlzjerry:feat/2876-complex-stringmaker

Conversation

@fzlzjerry

Copy link
Copy Markdown

Description

Add an opt-in StringMaker<std::complex<T>> with configurable precision for float, double and long double components. Each component type has its own setting, defaulting to max_digits10.

This follows the existing optional stringmaker mechanism, including the ALL toggle, CMake option, generated configuration header and Bazel template. It retains the standard (real,imag) stream format and leaves scalar precision settings and the non-opt-in fallback unchanged.

Validation

  • 11 new cases / 37 assertions cover round-tripping, runtime precision, special values, independent settings and stream reuse.
  • GCC 14.2 / C++14: basic preset 81/81 CTest checks and full all-tests preset 143/143 pass. The discovery checks use a private writable runtime/temp directory.
  • Clang 19.1.7 / C++20 shared library with the individual option: 81/81 checks pass.
  • Installed-package consumers verify cross-translation-unit settings and actual assertion diagnostics; the generated amalgamation also compiles and runs the API.
  • With ALL stringmakers enabled, the existing pair/tuple reporter-baseline mismatch remains: 80/81 checks pass, and all eight differing output files are byte-identical on pristine base and candidate. No reporter baselines were changed.

GitHub Issues

Refs #2876.

Copilot AI lite review requested due to automatic review settings September 10, 2026 21:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.18%. Comparing base (897d804) to head (b36caf1).

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3203      +/-   ##
==========================================
+ Coverage   91.17%   91.18%   +0.01%     
==========================================
  Files         206      206              
  Lines        9031     9037       +6     
==========================================
+ Hits         8234     8240       +6     
  Misses        797      797              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants