Skip to content

Commit 9cef81f

Browse files
committed
Fix warnings in test code.
1 parent a5526e8 commit 9cef81f

File tree

3 files changed

+40
-40
lines changed

3 files changed

+40
-40
lines changed

src/common/classes/tests/ArrayTest.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BOOST_AUTO_TEST_CASE(ConstructionWithStdInitializerTest)
1414
{
1515
Array<int> array(*getDefaultMemoryPool(), {1, 2, 3, 4});
1616

17-
BOOST_TEST(array.getCount() == 4);
17+
BOOST_TEST(array.getCount() == 4u);
1818
BOOST_TEST(array[0] == 1);
1919
BOOST_TEST(array[3] == 4);
2020
}
@@ -23,35 +23,35 @@ BOOST_AUTO_TEST_CASE(ClearTest)
2323
{
2424
Array<int> array(*getDefaultMemoryPool(), {1, 2, 3, 4});
2525

26-
BOOST_TEST(array.getCount() == 4);
26+
BOOST_TEST(array.getCount() == 4u);
2727

2828
array.clear();
29-
BOOST_TEST(array.getCount() == 0);
29+
BOOST_TEST(array.getCount() == 0u);
3030
}
3131

3232
BOOST_AUTO_TEST_CASE(IsEmptyAndHasDataTest)
3333
{
3434
Array<int> array(*getDefaultMemoryPool(), {1, 2, 3, 4});
3535

36-
BOOST_TEST(array.getCount() > 0);
36+
BOOST_TEST(array.getCount() > 0u);
3737
BOOST_TEST(!array.isEmpty());
3838
BOOST_TEST(array.hasData());
3939

4040
array.clear();
41-
BOOST_TEST(array.getCount() == 0);
41+
BOOST_TEST(array.getCount() == 0u);
4242
BOOST_TEST(array.isEmpty());
4343
BOOST_TEST(!array.hasData());
4444
}
4545

4646
BOOST_AUTO_TEST_CASE(CapacityAndCountTest)
4747
{
4848
Array<int> array1(10);
49-
BOOST_TEST(array1.getCapacity() == 10);
50-
BOOST_TEST(array1.getCount() == 0);
49+
BOOST_TEST(array1.getCapacity() == 10u);
50+
BOOST_TEST(array1.getCount() == 0u);
5151

5252
Array<int> array2(*getDefaultMemoryPool(), 11);
53-
BOOST_TEST(array2.getCapacity() == 11);
54-
BOOST_TEST(array2.getCount() == 0);
53+
BOOST_TEST(array2.getCapacity() == 11u);
54+
BOOST_TEST(array2.getCount() == 0u);
5555
}
5656

5757
BOOST_AUTO_TEST_SUITE_END() // ArrayTests

src/common/classes/tests/DoublyLinkedListTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE(ConstructionWithStdInitializerTest)
1717
{
1818
DoublyLinkedList<int> list(*getDefaultMemoryPool(), {1, 2, 3, 4});
1919

20-
BOOST_TEST(list.getCount() == 4);
20+
BOOST_TEST(list.getCount() == 4u);
2121
BOOST_TEST(list.front() == 1);
2222
BOOST_TEST(list.back() == 4);
2323
}
@@ -26,10 +26,10 @@ BOOST_AUTO_TEST_CASE(ClearTest)
2626
{
2727
DoublyLinkedList<int> list(*getDefaultMemoryPool(), {1, 2, 3, 4});
2828

29-
BOOST_TEST(list.getCount() == 4);
29+
BOOST_TEST(list.getCount() == 4u);
3030

3131
list.clear();
32-
BOOST_TEST(list.getCount() == 0);
32+
BOOST_TEST(list.getCount() == 0u);
3333
}
3434

3535
BOOST_AUTO_TEST_CASE(SpliceTest)

src/common/tests/StringTest.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -418,61 +418,61 @@ BOOST_AUTO_TEST_CASE(FindTest)
418418
// 9
419419
string b = "345";
420420

421-
check(a.find(b), 3);
422-
check(a.find("45"), 4);
423-
check(a.find('5'), 5);
421+
check(a.find(b), 3u);
422+
check(a.find("45"), 4u);
423+
check(a.find('5'), 5u);
424424
check(a.find("ZZ"), string::npos);
425425

426-
check(a.rfind(b), 9);
427-
check(a.rfind("45"), 10);
428-
check(a.rfind('5'), 11);
426+
check(a.rfind(b), 9u);
427+
check(a.rfind("45"), 10u);
428+
check(a.rfind('5'), 11u);
429429
check(a.rfind("ZZ"), string::npos);
430430

431-
check(a.find("45", 8), 10);
431+
check(a.find("45", 8), 10u);
432432

433-
check(a.find_first_of("aub"), 6);
434-
check(a.find_first_of(b), 3);
435-
check(a.find_first_of("54"), 4);
436-
check(a.find_first_of('5'), 5);
433+
check(a.find_first_of("aub"), 6u);
434+
check(a.find_first_of(b), 3u);
435+
check(a.find_first_of("54"), 4u);
436+
check(a.find_first_of('5'), 5u);
437437
check(a.find_first_of("ZZ"), string::npos);
438438

439-
check(a.find_last_of("aub"), 8);
440-
check(a.find_last_of(b), 11);
441-
check(a.find_last_of("54"), 11);
442-
check(a.find_last_of('5'), 11);
439+
check(a.find_last_of("aub"), 8u);
440+
check(a.find_last_of(b), 11u);
441+
check(a.find_last_of("54"), 11u);
442+
check(a.find_last_of('5'), 11u);
443443
check(a.find_last_of("ZZ"), string::npos);
444444

445-
check(a.find_first_of("45", 8), 10);
445+
check(a.find_first_of("45", 8u), 10u);
446446

447447
b = "010";
448-
check(a.find_first_not_of("aub"), 0);
449-
check(a.find_first_not_of(b), 2);
450-
check(a.find_first_not_of("0102"), 3);
451-
check(a.find_first_not_of('0'), 1);
448+
check(a.find_first_not_of("aub"), 0u);
449+
check(a.find_first_not_of(b), 2u);
450+
check(a.find_first_not_of("0102"), 3u);
451+
check(a.find_first_not_of('0'), 1u);
452452
check(a.find_first_not_of(a), string::npos);
453453

454454
b = "878";
455-
check(a.find_last_not_of("aub"), 14);
456-
check(a.find_last_not_of(b), 12);
457-
check(a.find_last_not_of("78"), 12);
458-
check(a.find_last_not_of('8'), 13);
455+
check(a.find_last_not_of("aub"), 14u);
456+
check(a.find_last_not_of(b), 12u);
457+
check(a.find_last_not_of("78"), 12u);
458+
check(a.find_last_not_of('8'), 13u);
459459
check(a.find_last_not_of(a), string::npos);
460460

461-
check(a.find_first_not_of("u345", 8), 12);
461+
check(a.find_first_not_of("u345", 8u), 12u);
462462
}
463463

464464
BOOST_AUTO_TEST_CASE(SubstrTest)
465465
{
466466
string a = lbl;
467467
string b;
468468

469-
b = a.substr(3, 4);
469+
b = a.substr(3u, 4u);
470470
validate(b, "3456");
471471

472-
b = a.substr(5, 20);
472+
b = a.substr(5u, 20u);
473473
validate(b, "56789");
474474

475-
b = a.substr(50, 20);
475+
b = a.substr(50u, 20u);
476476
validate(b, "");
477477
}
478478

0 commit comments

Comments
 (0)