mirror of
https://github.com/nlohmann/json.git
synced 2026-10-12 09:27:13 +00:00
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:
1 file changed
+2
-2
@@ -1750,7 +1750,7 @@ TEST_CASE("json_view large objects")
|
|||||||
for (int object = 0; object < objects; ++object)
|
for (int object = 0; object < objects; ++object)
|
||||||
{
|
{
|
||||||
text += object != 0 ? ",{" : "{";
|
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);
|
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)
|
for (int object = 0; object < 5; ++object)
|
||||||
{
|
{
|
||||||
const json_view v = d.root()[static_cast<std::size_t>(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);
|
CHECK(v[std::to_string(i)].get<int>() == i);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user