mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 12:43:02 +01:00
Fix warnings in test code.
This commit is contained in:
parent
a5526e898d
commit
9cef81f47d
@ -14,7 +14,7 @@ BOOST_AUTO_TEST_CASE(ConstructionWithStdInitializerTest)
|
||||
{
|
||||
Array<int> array(*getDefaultMemoryPool(), {1, 2, 3, 4});
|
||||
|
||||
BOOST_TEST(array.getCount() == 4);
|
||||
BOOST_TEST(array.getCount() == 4u);
|
||||
BOOST_TEST(array[0] == 1);
|
||||
BOOST_TEST(array[3] == 4);
|
||||
}
|
||||
@ -23,22 +23,22 @@ BOOST_AUTO_TEST_CASE(ClearTest)
|
||||
{
|
||||
Array<int> array(*getDefaultMemoryPool(), {1, 2, 3, 4});
|
||||
|
||||
BOOST_TEST(array.getCount() == 4);
|
||||
BOOST_TEST(array.getCount() == 4u);
|
||||
|
||||
array.clear();
|
||||
BOOST_TEST(array.getCount() == 0);
|
||||
BOOST_TEST(array.getCount() == 0u);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(IsEmptyAndHasDataTest)
|
||||
{
|
||||
Array<int> array(*getDefaultMemoryPool(), {1, 2, 3, 4});
|
||||
|
||||
BOOST_TEST(array.getCount() > 0);
|
||||
BOOST_TEST(array.getCount() > 0u);
|
||||
BOOST_TEST(!array.isEmpty());
|
||||
BOOST_TEST(array.hasData());
|
||||
|
||||
array.clear();
|
||||
BOOST_TEST(array.getCount() == 0);
|
||||
BOOST_TEST(array.getCount() == 0u);
|
||||
BOOST_TEST(array.isEmpty());
|
||||
BOOST_TEST(!array.hasData());
|
||||
}
|
||||
@ -46,12 +46,12 @@ BOOST_AUTO_TEST_CASE(IsEmptyAndHasDataTest)
|
||||
BOOST_AUTO_TEST_CASE(CapacityAndCountTest)
|
||||
{
|
||||
Array<int> array1(10);
|
||||
BOOST_TEST(array1.getCapacity() == 10);
|
||||
BOOST_TEST(array1.getCount() == 0);
|
||||
BOOST_TEST(array1.getCapacity() == 10u);
|
||||
BOOST_TEST(array1.getCount() == 0u);
|
||||
|
||||
Array<int> array2(*getDefaultMemoryPool(), 11);
|
||||
BOOST_TEST(array2.getCapacity() == 11);
|
||||
BOOST_TEST(array2.getCount() == 0);
|
||||
BOOST_TEST(array2.getCapacity() == 11u);
|
||||
BOOST_TEST(array2.getCount() == 0u);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END() // ArrayTests
|
||||
|
@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE(ConstructionWithStdInitializerTest)
|
||||
{
|
||||
DoublyLinkedList<int> list(*getDefaultMemoryPool(), {1, 2, 3, 4});
|
||||
|
||||
BOOST_TEST(list.getCount() == 4);
|
||||
BOOST_TEST(list.getCount() == 4u);
|
||||
BOOST_TEST(list.front() == 1);
|
||||
BOOST_TEST(list.back() == 4);
|
||||
}
|
||||
@ -26,10 +26,10 @@ BOOST_AUTO_TEST_CASE(ClearTest)
|
||||
{
|
||||
DoublyLinkedList<int> list(*getDefaultMemoryPool(), {1, 2, 3, 4});
|
||||
|
||||
BOOST_TEST(list.getCount() == 4);
|
||||
BOOST_TEST(list.getCount() == 4u);
|
||||
|
||||
list.clear();
|
||||
BOOST_TEST(list.getCount() == 0);
|
||||
BOOST_TEST(list.getCount() == 0u);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(SpliceTest)
|
||||
|
@ -418,47 +418,47 @@ BOOST_AUTO_TEST_CASE(FindTest)
|
||||
// 9
|
||||
string b = "345";
|
||||
|
||||
check(a.find(b), 3);
|
||||
check(a.find("45"), 4);
|
||||
check(a.find('5'), 5);
|
||||
check(a.find(b), 3u);
|
||||
check(a.find("45"), 4u);
|
||||
check(a.find('5'), 5u);
|
||||
check(a.find("ZZ"), string::npos);
|
||||
|
||||
check(a.rfind(b), 9);
|
||||
check(a.rfind("45"), 10);
|
||||
check(a.rfind('5'), 11);
|
||||
check(a.rfind(b), 9u);
|
||||
check(a.rfind("45"), 10u);
|
||||
check(a.rfind('5'), 11u);
|
||||
check(a.rfind("ZZ"), string::npos);
|
||||
|
||||
check(a.find("45", 8), 10);
|
||||
check(a.find("45", 8), 10u);
|
||||
|
||||
check(a.find_first_of("aub"), 6);
|
||||
check(a.find_first_of(b), 3);
|
||||
check(a.find_first_of("54"), 4);
|
||||
check(a.find_first_of('5'), 5);
|
||||
check(a.find_first_of("aub"), 6u);
|
||||
check(a.find_first_of(b), 3u);
|
||||
check(a.find_first_of("54"), 4u);
|
||||
check(a.find_first_of('5'), 5u);
|
||||
check(a.find_first_of("ZZ"), string::npos);
|
||||
|
||||
check(a.find_last_of("aub"), 8);
|
||||
check(a.find_last_of(b), 11);
|
||||
check(a.find_last_of("54"), 11);
|
||||
check(a.find_last_of('5'), 11);
|
||||
check(a.find_last_of("aub"), 8u);
|
||||
check(a.find_last_of(b), 11u);
|
||||
check(a.find_last_of("54"), 11u);
|
||||
check(a.find_last_of('5'), 11u);
|
||||
check(a.find_last_of("ZZ"), string::npos);
|
||||
|
||||
check(a.find_first_of("45", 8), 10);
|
||||
check(a.find_first_of("45", 8u), 10u);
|
||||
|
||||
b = "010";
|
||||
check(a.find_first_not_of("aub"), 0);
|
||||
check(a.find_first_not_of(b), 2);
|
||||
check(a.find_first_not_of("0102"), 3);
|
||||
check(a.find_first_not_of('0'), 1);
|
||||
check(a.find_first_not_of("aub"), 0u);
|
||||
check(a.find_first_not_of(b), 2u);
|
||||
check(a.find_first_not_of("0102"), 3u);
|
||||
check(a.find_first_not_of('0'), 1u);
|
||||
check(a.find_first_not_of(a), string::npos);
|
||||
|
||||
b = "878";
|
||||
check(a.find_last_not_of("aub"), 14);
|
||||
check(a.find_last_not_of(b), 12);
|
||||
check(a.find_last_not_of("78"), 12);
|
||||
check(a.find_last_not_of('8'), 13);
|
||||
check(a.find_last_not_of("aub"), 14u);
|
||||
check(a.find_last_not_of(b), 12u);
|
||||
check(a.find_last_not_of("78"), 12u);
|
||||
check(a.find_last_not_of('8'), 13u);
|
||||
check(a.find_last_not_of(a), string::npos);
|
||||
|
||||
check(a.find_first_not_of("u345", 8), 12);
|
||||
check(a.find_first_not_of("u345", 8u), 12u);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(SubstrTest)
|
||||
@ -466,13 +466,13 @@ BOOST_AUTO_TEST_CASE(SubstrTest)
|
||||
string a = lbl;
|
||||
string b;
|
||||
|
||||
b = a.substr(3, 4);
|
||||
b = a.substr(3u, 4u);
|
||||
validate(b, "3456");
|
||||
|
||||
b = a.substr(5, 20);
|
||||
b = a.substr(5u, 20u);
|
||||
validate(b, "56789");
|
||||
|
||||
b = a.substr(50, 20);
|
||||
b = a.substr(50u, 20u);
|
||||
validate(b, "");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user