• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nlohmann / json / 37530611400
99%

Build:
DEFAULT BRANCH: develop
Ran 06 Oct 2026 11:32PM UTC
Jobs 1
Files 37
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Oct 2026 08:59PM UTC coverage: 98.507% (-0.08%) from 98.591%
37530611400

push

github

web-flow
Create a value before giving it its type (#5585)

* Create a value before giving it its type

Squashed onto develop from:
- Create a value before giving it its type
- Skip the failed-allocation test when exceptions are disabled
- Keep the created pointer rather than an uninitialized json_value
- Skip the vector<bool> failed-allocation check for VS 2015 with iterator debugging
- Test the remaining to_json overloads with a failing allocation
- Skip the to_json allocation-failure section on VS 2015 Debug
- Fix false GCC -Warray-bounds error with JSON_DIAGNOSTICS at -O3 (#5744)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Store the new value with a helper in all to_json constructors

Every external_constructor<>::construct now creates the new value first and
hands it to basic_json::replace_value(), which destroys the old value, stores
the new one before setting its type (as elsewhere in this PR), sets the
parents, and checks the invariant.

The std::vector<bool> and std::valarray overloads use array_t's range
constructor, which the other array overloads already rely on. Range views
keep their loop, as begin() and end() of a view may have different types.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

2956 of 3170 branches covered (93.25%)

50 of 50 new or added lines in 2 files covered. (100.0%)

80 existing lines in 8 files now uncovered.

8580 of 8710 relevant lines covered (98.51%)

7333755.87 hits per line

Coverage Regressions

Lines Coverage ∆ File
53
97.37
0.19% include/nlohmann/json.hpp
15
98.27
0.0% include/nlohmann/detail/input/binary_reader.hpp
5
97.99
-2.01% include/nlohmann/detail/conversions/to_chars.hpp
3
99.69
-0.2% include/nlohmann/detail/output/binary_writer.hpp
1
99.44
0.01% include/nlohmann/detail/input/parser.hpp
1
98.28
-1.72% include/nlohmann/detail/output/output_adapters.hpp
1
99.25
-0.19% include/nlohmann/detail/output/serializer.hpp
1
89.41
-1.06% include/nlohmann/detail/string_utils.hpp
Jobs
ID Job ID Ran Files Coverage
1 37530611400.1 06 Oct 2026 11:32PM UTC 37
98.51
GitHub Action Run
Source Files on build 37530611400
  • Tree
  • List 37
  • Changed 13
  • Source Changed 8
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37530611400
  • 21a69230 on github
  • Prev Build on develop (#37231157998)
  • Next Build on develop (#37638246347)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc