Files
json/tests
Kirill Lokotkov 4e5fa3bdd2 Fix long double inf test under Valgrind. Fixes #5175 (#5176)
* Fix for printing long doubles bug in dump_float

When you use long double as a floating point type with the current version of this file and try to dump json it prints trash instead of actual number. This if-else fixes the problem. On using long double you just need to add an 'L' modifier before 'g' in format string.

Signed-off-by: Kirill Lokotkov <klokotkov@ya.ru>

* C++11 compatibility

Signed-off-by: Kirill Lokotkov <klokotkov@ya.ru>

* Shorter solution

Signed-off-by: Kirill Lokotkov <klokotkov@ya.ru>

* Applied amalgamate

Signed-off-by: rusloker <klokotkov@ya.ru>

* Add unit tests for `dump()` with `long double` in custom `basic_json`

Signed-off-by: rusloker <klokotkov@ya.ru>

* Fix UB in `snprintf_float` by using `%.*Lg` for `long double`

Signed-off-by: rusloker <klokotkov@ya.ru>

* Use `std::array` for `values` in serialization unit tests to improve type safety

Signed-off-by: rusloker <klokotkov@ya.ru>

* Fix brace initialization for `std::array` in serialization unit tests

Signed-off-by: rusloker <klokotkov@ya.ru>

* Remove comments in `snprintf_float` regarding `%Lg` usage

Signed-off-by: rusloker <klokotkov@ya.ru>

* Skip `long double` infinity dump assertions under Valgrind

Signed-off-by: rusloker <klokotkov@ya.ru>

* Clarify Valgrind bug-tracker reference in `long double` test

Signed-off-by: rusloker <klokotkov@ya.ru>

* Satisfy clang-tidy in `long double` infinity probe

Signed-off-by: rusloker <klokotkov@ya.ru>

---------

Signed-off-by: Kirill Lokotkov <klokotkov@ya.ru>
Signed-off-by: rusloker <klokotkov@ya.ru>
2026-05-17 08:27:06 +02:00
..
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2026-01-01 20:00:39 +01:00
2022-05-01 09:41:50 +02:00
2025-05-31 17:48:34 +02:00
2022-05-09 08:02:41 +02:00
2022-05-01 09:41:50 +02:00