Improve libstdc++ P0952 generate_cannonical tests.
The libstdc++ `generate_canonical` tests are reworked to improve coverage and reflect generator range sizes.
The generate_canonical tests in libstdc++ have been reworked to provide better coverage and clarity. Test names now reflect the size of the generator range, and duplicated code is extracted into a run_generator function. The update expands non-power of two ranges to cover all IEC559 floating-point types. The tested values are selected based on the size of the mantissa, accommodating different long double representations, and preventing infinite loops by limiting skips per element.
In Details
This commit refactors the P0952 generate_canonical tests in libstdc++. The changes focus on improving test coverage for various floating-point types and generator ranges. The selection of test values now depends on the mantissa size, indicating an awareness of different long double representations. The addition of max_skips_per_elem suggests a concern for potential infinite loops during test execution. The tests target the uniform_real_distribution class.
For Context
The C++ Standard Library provides tools for generating random numbers with specific distributions. The generate_canonical function produces floating-point values uniformly distributed between 0 and 1. This commit improves the test suite for this functionality in libstdc++, the GNU C++ Standard Library implementation. The changes ensure thorough testing across different floating-point types and generator ranges, enhancing the reliability of the random number generation facilities.