@@ -332,7 +332,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, arrays) {
332
332
JSONTEST_FIXTURE_LOCAL (ValueTest, resizeArray) {
333
333
Json::Value array;
334
334
{
335
- for (int i = 0 ; i < 10 ; i++)
335
+ for (Json::ArrayIndex i = 0 ; i < 10 ; i++)
336
336
array[i] = i;
337
337
JSONTEST_ASSERT_EQUAL (array.size (), 10 );
338
338
// The length set is greater than the length of the array.
@@ -348,7 +348,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, resizeArray) {
348
348
JSONTEST_ASSERT_EQUAL (array.size (), 0 );
349
349
}
350
350
{
351
- for (int i = 0 ; i < 10 ; i++)
351
+ for (Json::ArrayIndex i = 0 ; i < 10 ; i++)
352
352
array[i] = i;
353
353
JSONTEST_ASSERT_EQUAL (array.size (), 10 );
354
354
array.clear ();
@@ -357,7 +357,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, resizeArray) {
357
357
}
358
358
JSONTEST_FIXTURE_LOCAL (ValueTest, getArrayValue) {
359
359
Json::Value array;
360
- for (int i = 0 ; i < 5 ; i++)
360
+ for (Json::ArrayIndex i = 0 ; i < 5 ; i++)
361
361
array[i] = i;
362
362
363
363
JSONTEST_ASSERT_EQUAL (array.size (), 5 );
@@ -395,7 +395,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, arrayInsertAtRandomIndex) {
395
395
array.append (str0); // append lvalue
396
396
397
397
std::vector<Json::Value*> vec; // storage value address for checking
398
- for (int i = 0 ; i < 3 ; i++) {
398
+ for (Json::ArrayIndex i = 0 ; i < 3 ; i++) {
399
399
vec.push_back (&array[i]);
400
400
}
401
401
JSONTEST_ASSERT_EQUAL (Json::Value (" index0" ), array[0 ]); // check append
@@ -2265,7 +2265,7 @@ JSONTEST_FIXTURE_LOCAL(StyledWriterTest, multiLineArray) {
2265
2265
" 15,\n 16,\n 17,\n "
2266
2266
" 18,\n 19,\n 20\n ]\n " );
2267
2267
Json::Value root;
2268
- for (int i = 0 ; i < 21 ; i++)
2268
+ for (Json::ArrayIndex i = 0 ; i < 21 ; i++)
2269
2269
root[i] = i;
2270
2270
const Json::String result = writer.write (root);
2271
2271
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
@@ -2274,7 +2274,7 @@ JSONTEST_FIXTURE_LOCAL(StyledWriterTest, multiLineArray) {
2274
2274
// Array members do not exceed 21 print effects to render a single line
2275
2275
const Json::String expected (" [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n " );
2276
2276
Json::Value root;
2277
- for (int i = 0 ; i < 10 ; i++)
2277
+ for (Json::ArrayIndex i = 0 ; i < 10 ; i++)
2278
2278
root[i] = i;
2279
2279
const Json::String result = writer.write (root);
2280
2280
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
@@ -2400,7 +2400,7 @@ JSONTEST_FIXTURE_LOCAL(StyledStreamWriterTest, multiLineArray) {
2400
2400
" \n\t 20\n ]\n " );
2401
2401
Json::StyledStreamWriter writer;
2402
2402
Json::Value root;
2403
- for (int i = 0 ; i < 21 ; i++)
2403
+ for (Json::ArrayIndex i = 0 ; i < 21 ; i++)
2404
2404
root[i] = i;
2405
2405
Json::OStringStream sout;
2406
2406
writer.write (sout, root);
@@ -2412,7 +2412,7 @@ JSONTEST_FIXTURE_LOCAL(StyledStreamWriterTest, multiLineArray) {
2412
2412
// Array members do not exceed 21 print effects to render a single line
2413
2413
const Json::String expected (" [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n " );
2414
2414
Json::Value root;
2415
- for (int i = 0 ; i < 10 ; i++)
2415
+ for (Json::ArrayIndex i = 0 ; i < 10 ; i++)
2416
2416
root[i] = i;
2417
2417
Json::OStringStream sout;
2418
2418
writer.write (sout, root);
@@ -2547,7 +2547,7 @@ JSONTEST_FIXTURE_LOCAL(StreamWriterTest, multiLineArray) {
2547
2547
" \n\t 19,"
2548
2548
" \n\t 20\n ]" );
2549
2549
Json::Value root;
2550
- for (int i = 0 ; i < 21 ; i++)
2550
+ for (Json::ArrayIndex i = 0 ; i < 21 ; i++)
2551
2551
root[i] = i;
2552
2552
const Json::String result = Json::writeString (wb, root);
2553
2553
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
@@ -2556,7 +2556,7 @@ JSONTEST_FIXTURE_LOCAL(StreamWriterTest, multiLineArray) {
2556
2556
// Array members do not exceed 21 print effects to render a single line
2557
2557
const Json::String expected (" [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]" );
2558
2558
Json::Value root;
2559
- for (int i = 0 ; i < 10 ; i++)
2559
+ for (Json::ArrayIndex i = 0 ; i < 10 ; i++)
2560
2560
root[i] = i;
2561
2561
const Json::String result = Json::writeString (wb, root);
2562
2562
JSONTEST_ASSERT_STRING_EQUAL (expected, result);
0 commit comments