Avoid GCC useless-cast and strict-overflow warnings in unit-json_view.cpp

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-11 10:28:26 +02:00
1 parent 9a5c0ef4a7
commit d3137f4161
1 file changed
+2 -2
+2 -2
View File
@@ -1750,7 +1750,7 @@ TEST_CASE("json_view large objects")
for (int object = 0; object < objects; ++object)
{
text += object != 0 ? ",{" : "{";
for (int i = 0; i < members + object; ++i)
for (int i = 0, n = members + object; i < n; ++i)
{
text += (i != 0 ? ",\"" : "\"") + std::to_string(i) + "\":" + std::to_string(i);
}
@@ -1777,7 +1777,7 @@ TEST_CASE("json_view large objects")
for (int object = 0; object < 5; ++object)
{
const json_view v = d.root()[static_cast<std::size_t>(object)];
for (int i = 0; i < 150 + object; ++i)
for (int i = 0, n = 150 + object; i < n; ++i)
{
CHECK(v[std::to_string(i)].get<int>() == i);
}