Skip to content

update coverage badge and change int to Json::ArrayIndex in for-loop #1088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![badge](https://img.shields.io/badge/conan.io-jsoncpp%2F1.8.0-green.svg?logo=data:image/png;base64%2CiVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAAA1VBMVEUAAABhlctjlstkl8tlmMtlmMxlmcxmmcxnmsxpnMxpnM1qnc1sn85voM91oM11oc1xotB2oc56pNF6pNJ2ptJ8ptJ8ptN9ptN8p9N5qNJ9p9N9p9R8qtOBqdSAqtOAqtR%2BrNSCrNJ/rdWDrNWCsNWCsNaJs9eLs9iRvNuVvdyVv9yXwd2Zwt6axN6dxt%2Bfx%2BChyeGiyuGjyuCjyuGly%2BGlzOKmzOGozuKoz%2BKqz%2BOq0OOv1OWw1OWw1eWx1eWy1uay1%2Baz1%2Baz1%2Bez2Oe02Oe12ee22ujUGwH3AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfgBQkREyOxFIh/AAAAiklEQVQI12NgAAMbOwY4sLZ2NtQ1coVKWNvoc/Eq8XDr2wB5Ig62ekza9vaOqpK2TpoMzOxaFtwqZua2Bm4makIM7OzMAjoaCqYuxooSUqJALjs7o4yVpbowvzSUy87KqSwmxQfnsrPISyFzWeWAXCkpMaBVIC4bmCsOdgiUKwh3JojLgAQ4ZCE0AMm2D29tZwe6AAAAAElFTkSuQmCC)](https://bintray.com/theirix/conan-repo/jsoncpp%3Atheirix)
[![badge](https://img.shields.io/badge/license-MIT-blue)](https://github.com/open-source-parsers/jsoncpp/blob/master/LICENSE)
[![badge](https://img.shields.io/badge/document-doxygen-brightgreen)](http://open-source-parsers.github.io/jsoncpp-docs/doxygen/index.html)
[![Coverage Status](https://coveralls.io/repos/github/open-source-parsers/jsoncpp/badge.svg)](https://coveralls.io/github/open-source-parsers/jsoncpp)
[![Coverage Status](https://coveralls.io/repos/github/open-source-parsers/jsoncpp/badge.svg?branch=master)](https://coveralls.io/github/open-source-parsers/jsoncpp?branch=master)


[JSON][json-org] is a lightweight data-interchange format. It can represent
Expand Down
20 changes: 10 additions & 10 deletions src/test_lib_json/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, arrays) {
JSONTEST_FIXTURE_LOCAL(ValueTest, resizeArray) {
Json::Value array;
{
for (int i = 0; i < 10; i++)
for (Json::ArrayIndex i = 0; i < 10; i++)
array[i] = i;
JSONTEST_ASSERT_EQUAL(array.size(), 10);
// The length set is greater than the length of the array.
Expand All @@ -348,7 +348,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, resizeArray) {
JSONTEST_ASSERT_EQUAL(array.size(), 0);
}
{
for (int i = 0; i < 10; i++)
for (Json::ArrayIndex i = 0; i < 10; i++)
array[i] = i;
JSONTEST_ASSERT_EQUAL(array.size(), 10);
array.clear();
Expand All @@ -357,7 +357,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, resizeArray) {
}
JSONTEST_FIXTURE_LOCAL(ValueTest, getArrayValue) {
Json::Value array;
for (int i = 0; i < 5; i++)
for (Json::ArrayIndex i = 0; i < 5; i++)
array[i] = i;

JSONTEST_ASSERT_EQUAL(array.size(), 5);
Expand Down Expand Up @@ -395,7 +395,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, arrayInsertAtRandomIndex) {
array.append(str0); // append lvalue

std::vector<Json::Value*> vec; // storage value address for checking
for (int i = 0; i < 3; i++) {
for (Json::ArrayIndex i = 0; i < 3; i++) {
vec.push_back(&array[i]);
}
JSONTEST_ASSERT_EQUAL(Json::Value("index0"), array[0]); // check append
Expand Down Expand Up @@ -2265,7 +2265,7 @@ JSONTEST_FIXTURE_LOCAL(StyledWriterTest, multiLineArray) {
"15,\n 16,\n 17,\n "
"18,\n 19,\n 20\n]\n");
Json::Value root;
for (int i = 0; i < 21; i++)
for (Json::ArrayIndex i = 0; i < 21; i++)
root[i] = i;
const Json::String result = writer.write(root);
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
Expand All @@ -2274,7 +2274,7 @@ JSONTEST_FIXTURE_LOCAL(StyledWriterTest, multiLineArray) {
// Array members do not exceed 21 print effects to render a single line
const Json::String expected("[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n");
Json::Value root;
for (int i = 0; i < 10; i++)
for (Json::ArrayIndex i = 0; i < 10; i++)
root[i] = i;
const Json::String result = writer.write(root);
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
Expand Down Expand Up @@ -2400,7 +2400,7 @@ JSONTEST_FIXTURE_LOCAL(StyledStreamWriterTest, multiLineArray) {
"\n\t20\n]\n");
Json::StyledStreamWriter writer;
Json::Value root;
for (int i = 0; i < 21; i++)
for (Json::ArrayIndex i = 0; i < 21; i++)
root[i] = i;
Json::OStringStream sout;
writer.write(sout, root);
Expand All @@ -2412,7 +2412,7 @@ JSONTEST_FIXTURE_LOCAL(StyledStreamWriterTest, multiLineArray) {
// Array members do not exceed 21 print effects to render a single line
const Json::String expected("[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n");
Json::Value root;
for (int i = 0; i < 10; i++)
for (Json::ArrayIndex i = 0; i < 10; i++)
root[i] = i;
Json::OStringStream sout;
writer.write(sout, root);
Expand Down Expand Up @@ -2547,7 +2547,7 @@ JSONTEST_FIXTURE_LOCAL(StreamWriterTest, multiLineArray) {
"\n\t19,"
"\n\t20\n]");
Json::Value root;
for (int i = 0; i < 21; i++)
for (Json::ArrayIndex i = 0; i < 21; i++)
root[i] = i;
const Json::String result = Json::writeString(wb, root);
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
Expand All @@ -2556,7 +2556,7 @@ JSONTEST_FIXTURE_LOCAL(StreamWriterTest, multiLineArray) {
// Array members do not exceed 21 print effects to render a single line
const Json::String expected("[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]");
Json::Value root;
for (int i = 0; i < 10; i++)
for (Json::ArrayIndex i = 0; i < 10; i++)
root[i] = i;
const Json::String result = Json::writeString(wb, root);
JSONTEST_ASSERT_STRING_EQUAL(expected, result);
Expand Down