mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 19:51:58 +01:00
individually disable g++ unused warnings
This commit is contained in:
@@ -227,7 +227,7 @@ void AnyTest::testInt()
|
||||
std::string* s = AnyCast<std::string>(&a);
|
||||
assert (s == NULL);
|
||||
|
||||
int tmp = AnyCast<int>(a);
|
||||
int POCO_UNUSED tmp = AnyCast<int>(a);
|
||||
const Any c = a;
|
||||
tmp = AnyCast<int>(a);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void ClassLoaderTest::testClassLoader1()
|
||||
|
||||
try
|
||||
{
|
||||
const ClassLoader<TestPlugin>::Meta& meta = cl.classFor("PluginA");
|
||||
const ClassLoader<TestPlugin>::Meta& POCO_UNUSED meta = cl.classFor("PluginA");
|
||||
fail("not found - must throw exception");
|
||||
}
|
||||
catch (NotFoundException&)
|
||||
@@ -63,7 +63,7 @@ void ClassLoaderTest::testClassLoader1()
|
||||
|
||||
try
|
||||
{
|
||||
const ClassLoader<TestPlugin>::Manif& manif = cl.manifestFor(path);
|
||||
const ClassLoader<TestPlugin>::Manif& POCO_UNUSED manif = cl.manifestFor(path);
|
||||
fail("not found - must throw exception");
|
||||
}
|
||||
catch (NotFoundException&)
|
||||
@@ -122,7 +122,7 @@ void ClassLoaderTest::testClassLoader2()
|
||||
|
||||
try
|
||||
{
|
||||
TestPlugin& plgB = cl.instance("PluginB");
|
||||
TestPlugin& POCO_UNUSED plgB = cl.instance("PluginB");
|
||||
fail("not a singleton - must throw");
|
||||
}
|
||||
catch (InvalidAccessException&)
|
||||
@@ -131,7 +131,7 @@ void ClassLoaderTest::testClassLoader2()
|
||||
|
||||
try
|
||||
{
|
||||
TestPlugin* pPluginC = cl.create("PluginC");
|
||||
TestPlugin* POCO_UNUSED pPluginC = cl.create("PluginC");
|
||||
fail("cannot create a singleton - must throw");
|
||||
}
|
||||
catch (InvalidAccessException&)
|
||||
|
||||
@@ -470,7 +470,7 @@ void CoreTest::testFIFOBufferChar()
|
||||
assert ('7' == f[2]);
|
||||
assert ('8' == f[3]);
|
||||
assert ('9' == f[4]);
|
||||
try { T i = f[10]; fail ("must fail"); }
|
||||
try { T POCO_UNUSED i = f[10]; fail ("must fail"); }
|
||||
catch (InvalidAccessException&) { }
|
||||
|
||||
v.clear();
|
||||
@@ -498,7 +498,7 @@ void CoreTest::testFIFOBufferChar()
|
||||
assert ('h' == f[12]);
|
||||
assert ('i' == f[13]);
|
||||
assert ('j' == f[14]);
|
||||
try { T i = f[15]; fail ("must fail"); }
|
||||
try { T POCO_UNUSED i = f[15]; fail ("must fail"); }
|
||||
catch (InvalidAccessException&) { }
|
||||
|
||||
f.read(b, 10);
|
||||
@@ -510,7 +510,7 @@ void CoreTest::testFIFOBufferChar()
|
||||
assert ('h' == f[2]);
|
||||
assert ('i' == f[3]);
|
||||
assert ('j' == f[4]);
|
||||
try { T i = f[5]; fail ("must fail"); }
|
||||
try { T POCO_UNUSED i = f[5]; fail ("must fail"); }
|
||||
catch (InvalidAccessException&) { }
|
||||
|
||||
assert(1 == _notToReadable);
|
||||
@@ -526,7 +526,7 @@ void CoreTest::testFIFOBufferChar()
|
||||
assert (5 == b.size());
|
||||
assert (20 == f.size());
|
||||
assert (0 == f.used());
|
||||
try { T i = f[0]; fail ("must fail"); }
|
||||
try { T POCO_UNUSED i = f[0]; fail ("must fail"); }
|
||||
catch (InvalidAccessException&) { }
|
||||
assert (f.isEmpty());
|
||||
|
||||
@@ -797,7 +797,7 @@ void CoreTest::testFIFOBufferInt()
|
||||
assert (7 == f[2]);
|
||||
assert (8 == f[3]);
|
||||
assert (9 == f[4]);
|
||||
try { T i = f[10]; fail ("must fail"); }
|
||||
try { T POCO_UNUSED i = f[10]; fail ("must fail"); }
|
||||
catch (InvalidAccessException&) { }
|
||||
|
||||
v.clear();
|
||||
@@ -825,7 +825,7 @@ void CoreTest::testFIFOBufferInt()
|
||||
assert (17 == f[12]);
|
||||
assert (18 == f[13]);
|
||||
assert (19 == f[14]);
|
||||
try { T i = f[15]; fail ("must fail"); }
|
||||
try { T POCO_UNUSED i = f[15]; fail ("must fail"); }
|
||||
catch (InvalidAccessException&) { }
|
||||
|
||||
f.read(b, 10);
|
||||
@@ -837,14 +837,14 @@ void CoreTest::testFIFOBufferInt()
|
||||
assert (17 == f[2]);
|
||||
assert (18 == f[3]);
|
||||
assert (19 == f[4]);
|
||||
try { T i = f[5]; fail ("must fail"); }
|
||||
try { T POCO_UNUSED i = f[5]; fail ("must fail"); }
|
||||
catch (InvalidAccessException&) { }
|
||||
|
||||
f.read(b, 6);
|
||||
assert (5 == b.size());
|
||||
assert (20 == f.size());
|
||||
assert (0 == f.used());
|
||||
try { T i = f[0]; fail ("must fail"); }
|
||||
try { T POCO_UNUSED i = f[0]; fail ("must fail"); }
|
||||
catch (InvalidAccessException&) { }
|
||||
|
||||
assert (f.isEmpty());
|
||||
@@ -987,7 +987,7 @@ void CoreTest::testNullable()
|
||||
|
||||
try
|
||||
{
|
||||
int tmp = n1.value();
|
||||
int POCO_UNUSED tmp = n1.value();
|
||||
fail("null value, must throw");
|
||||
}
|
||||
catch (Poco::NullValueException&)
|
||||
|
||||
@@ -643,15 +643,15 @@ void DateTimeTest::testSetYearDay()
|
||||
const int num_data = sizeof data / sizeof *data;
|
||||
for (int di = 0; di < num_data; ++di)
|
||||
{
|
||||
const int line = data[di].d_lineNum;
|
||||
const int POCO_UNUSED line = data[di].d_lineNum;
|
||||
const int year = data[di].d_year;
|
||||
const unsigned int day = data[di].d_day;
|
||||
const unsigned int POCO_UNUSED day = data[di].d_day;
|
||||
|
||||
const int exp_month = data[di].d_expMonth;
|
||||
const unsigned int exp_day = data[di].d_expDay;
|
||||
const DateTime r(year, exp_month, exp_day);
|
||||
DateTime x;
|
||||
const DateTime& X = x;
|
||||
const DateTime& POCO_UNUSED X = x;
|
||||
|
||||
#if 0
|
||||
// TODO - need to be able to assign a day number in the year
|
||||
@@ -696,16 +696,16 @@ void DateTimeTest::testSetYearDay()
|
||||
const int num_data2 = sizeof data2 / sizeof *data2;
|
||||
for (int di = 0; di < num_data2; ++di)
|
||||
{
|
||||
const int line = data2[di].d_lineNum;
|
||||
const int year = data2[di].d_year;
|
||||
const int day = data2[di].d_day;
|
||||
const int POCO_UNUSED line = data2[di].d_lineNum;
|
||||
const int POCO_UNUSED year = data2[di].d_year;
|
||||
const int POCO_UNUSED day = data2[di].d_day;
|
||||
const int exp = data2[di].d_exp;
|
||||
DateTime x;
|
||||
const DateTime& X = x;
|
||||
const DateTime& POCO_UNUSED X = x;
|
||||
if (1 == exp)
|
||||
{
|
||||
DateTime r;
|
||||
const DateTime& r2 = r;
|
||||
const POCO_UNUSED DateTime& r2 = r;
|
||||
#if 0
|
||||
r.set(year, day);
|
||||
#endif
|
||||
|
||||
@@ -45,7 +45,7 @@ void FileTest::testFileAttributes1()
|
||||
|
||||
try
|
||||
{
|
||||
bool flag = f.canRead();
|
||||
bool POCO_UNUSED flag = f.canRead();
|
||||
failmsg("file does not exist - must throw exception");
|
||||
}
|
||||
catch (Exception&)
|
||||
@@ -54,7 +54,7 @@ void FileTest::testFileAttributes1()
|
||||
|
||||
try
|
||||
{
|
||||
bool flag = f.canWrite();
|
||||
bool POCO_UNUSED flag = f.canWrite();
|
||||
failmsg("file does not exist - must throw exception");
|
||||
}
|
||||
catch (Exception&)
|
||||
@@ -63,7 +63,7 @@ void FileTest::testFileAttributes1()
|
||||
|
||||
try
|
||||
{
|
||||
bool flag = f.isFile();
|
||||
bool POCO_UNUSED flag = f.isFile();
|
||||
failmsg("file does not exist - must throw exception");
|
||||
}
|
||||
catch (Exception&)
|
||||
@@ -72,7 +72,7 @@ void FileTest::testFileAttributes1()
|
||||
|
||||
try
|
||||
{
|
||||
bool flag = f.isDirectory();
|
||||
bool POCO_UNUSED flag = f.isDirectory();
|
||||
failmsg("file does not exist - must throw exception");
|
||||
}
|
||||
catch (Exception&)
|
||||
@@ -81,7 +81,7 @@ void FileTest::testFileAttributes1()
|
||||
|
||||
try
|
||||
{
|
||||
Timestamp ts = f.created();
|
||||
Timestamp POCO_UNUSED ts = f.created();
|
||||
failmsg("file does not exist - must throw exception");
|
||||
}
|
||||
catch (Exception&)
|
||||
@@ -90,7 +90,7 @@ void FileTest::testFileAttributes1()
|
||||
|
||||
try
|
||||
{
|
||||
Timestamp ts = f.getLastModified();
|
||||
Timestamp POCO_UNUSED ts = f.getLastModified();
|
||||
failmsg("file does not exist - must throw exception");
|
||||
}
|
||||
catch (Exception&)
|
||||
@@ -109,7 +109,7 @@ void FileTest::testFileAttributes1()
|
||||
|
||||
try
|
||||
{
|
||||
File::FileSize fs = f.getSize();
|
||||
File::FileSize POCO_UNUSED fs = f.getSize();
|
||||
failmsg("file does not exist - must throw exception");
|
||||
}
|
||||
catch (Exception&)
|
||||
|
||||
@@ -189,7 +189,7 @@ void HashMapTest::testIndex()
|
||||
try
|
||||
{
|
||||
const IntMap& im = hm;
|
||||
int x = im[4];
|
||||
int POCO_UNUSED x = im[4];
|
||||
fail("no such key - must throw");
|
||||
}
|
||||
catch (Poco::NotFoundException&)
|
||||
|
||||
@@ -102,9 +102,9 @@ void HashTableTest::testSize()
|
||||
{
|
||||
HashTable<std::string, int> hashTable(13);
|
||||
assert (hashTable.size() == 0);
|
||||
Poco::UInt32 h1 = hashTable.insert("1", 1);
|
||||
Poco::UInt32 POCO_UNUSED h1 = hashTable.insert("1", 1);
|
||||
assert (hashTable.size() == 1);
|
||||
Poco::UInt32 h2 = hashTable.update("2", 2);
|
||||
Poco::UInt32 POCO_UNUSED h2 = hashTable.update("2", 2);
|
||||
assert (hashTable.size() == 2);
|
||||
hashTable.remove("1");
|
||||
assert (hashTable.size() == 1);
|
||||
|
||||
@@ -72,7 +72,7 @@ void ListMapTest::testInsert()
|
||||
|
||||
void ListMapTest::testInsertOrder()
|
||||
{
|
||||
const int N = 1000;
|
||||
const int POCO_UNUSED N = 1000;
|
||||
|
||||
typedef ListMap<std::string, int> StrToIntMap;
|
||||
StrToIntMap lm;
|
||||
@@ -222,7 +222,7 @@ void ListMapTest::testIntIndex()
|
||||
try
|
||||
{
|
||||
const IntMap& im = hm;
|
||||
int x = im[4];
|
||||
int POCO_UNUSED x = im[4];
|
||||
fail("no such key - must throw");
|
||||
}
|
||||
catch (Poco::NotFoundException&)
|
||||
|
||||
@@ -126,7 +126,7 @@ void LoggingRegistryTest::testUnregister()
|
||||
|
||||
try
|
||||
{
|
||||
Channel* pC = reg.channelForName("c1");
|
||||
Channel* POCO_UNUSED pC = reg.channelForName("c1");
|
||||
fail("unregistered - must throw");
|
||||
}
|
||||
catch (Poco::NotFoundException&)
|
||||
@@ -135,7 +135,7 @@ void LoggingRegistryTest::testUnregister()
|
||||
|
||||
try
|
||||
{
|
||||
Formatter* pF = reg.formatterForName("f2");
|
||||
Formatter* POCO_UNUSED pF = reg.formatterForName("f2");
|
||||
fail("unregistered - must throw");
|
||||
}
|
||||
catch (Poco::NotFoundException&)
|
||||
|
||||
@@ -50,7 +50,7 @@ void NamedTuplesTest::testNamedTuple1()
|
||||
|
||||
assert (aTuple["A"] == "");
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 1);
|
||||
|
||||
@@ -86,7 +86,7 @@ void NamedTuplesTest::testNamedTuple2()
|
||||
assert (aTuple["A"] == "");
|
||||
assert (aTuple["B"] == 0);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 2);
|
||||
|
||||
@@ -128,7 +128,7 @@ void NamedTuplesTest::testNamedTuple3()
|
||||
assert (aTuple["B"] == 0);
|
||||
assert (aTuple["C"] == false);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 3);
|
||||
|
||||
@@ -174,7 +174,7 @@ void NamedTuplesTest::testNamedTuple4()
|
||||
assert (aTuple["B"] == 0);
|
||||
assert (aTuple["C"] == false);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 4);
|
||||
|
||||
@@ -224,7 +224,7 @@ void NamedTuplesTest::testNamedTuple5()
|
||||
assert (aTuple["C"] == false);
|
||||
assert (aTuple["E"] == 0);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 5);
|
||||
|
||||
@@ -279,7 +279,7 @@ void NamedTuplesTest::testNamedTuple6()
|
||||
assert (aTuple["E"] == 0);
|
||||
assert (aTuple["F"] == 0);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 6);
|
||||
|
||||
@@ -338,7 +338,7 @@ void NamedTuplesTest::testNamedTuple7()
|
||||
assert (aTuple["E"] == 0);
|
||||
assert (aTuple["F"] == 0);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 7);
|
||||
|
||||
@@ -401,7 +401,7 @@ void NamedTuplesTest::testNamedTuple8()
|
||||
assert (aTuple["F"] == 0);
|
||||
assert (aTuple["H"] == 0);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 8);
|
||||
|
||||
@@ -470,7 +470,7 @@ void NamedTuplesTest::testNamedTuple9()
|
||||
assert (aTuple["H"] == 0);
|
||||
assert (aTuple["I"] == "");
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 9);
|
||||
|
||||
@@ -543,7 +543,7 @@ void NamedTuplesTest::testNamedTuple10()
|
||||
assert (aTuple["I"] == "");
|
||||
assert (aTuple["J"] == 0);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 10);
|
||||
|
||||
@@ -621,7 +621,7 @@ void NamedTuplesTest::testNamedTuple11()
|
||||
assert (aTuple["J"] == 0);
|
||||
assert (aTuple["K"] == "");
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 11);
|
||||
|
||||
@@ -704,7 +704,7 @@ void NamedTuplesTest::testNamedTuple12()
|
||||
assert (aTuple["K"] == "");
|
||||
assert (aTuple["L"] == 0);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 12);
|
||||
|
||||
@@ -791,7 +791,7 @@ void NamedTuplesTest::testNamedTuple13()
|
||||
assert (aTuple["L"] == 0);
|
||||
assert (aTuple["M"] == false);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 13);
|
||||
|
||||
@@ -881,7 +881,7 @@ void NamedTuplesTest::testNamedTuple14()
|
||||
assert (aTuple["L"] == 0);
|
||||
assert (aTuple["M"] == false);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 14);
|
||||
|
||||
@@ -975,7 +975,7 @@ void NamedTuplesTest::testNamedTuple15()
|
||||
assert (aTuple["L"] == 0);
|
||||
assert (aTuple["M"] == false);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 15);
|
||||
|
||||
@@ -1074,7 +1074,7 @@ void NamedTuplesTest::testNamedTuple16()
|
||||
assert (aTuple["M"] == false);
|
||||
assert (aTuple["O"] == 0);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 16);
|
||||
|
||||
@@ -1179,7 +1179,7 @@ void NamedTuplesTest::testNamedTuple17()
|
||||
assert (aTuple["O"] == 0);
|
||||
assert (aTuple["P"] == 0);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 17);
|
||||
|
||||
@@ -1289,7 +1289,7 @@ void NamedTuplesTest::testNamedTuple18()
|
||||
assert (aTuple["P"] == 0);
|
||||
assert (aTuple["R"] == 0);
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 18);
|
||||
|
||||
@@ -1404,7 +1404,7 @@ void NamedTuplesTest::testNamedTuple19()
|
||||
assert (aTuple["R"] == 0);
|
||||
assert (aTuple["S"] == "");
|
||||
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 19);
|
||||
|
||||
@@ -1523,7 +1523,7 @@ void NamedTuplesTest::testNamedTuple20()
|
||||
assert (aTuple["R"] == 0);
|
||||
assert (aTuple["S"] == "");
|
||||
assert (aTuple["T"] == 0);
|
||||
try { int xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
try { int POCO_UNUSED xyz; xyz = aTuple["XYZ"]; fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
assert (aTuple.length == 20);
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ void ProcessTest::testIsRunning()
|
||||
PipeOutputStream ostr(inPipe);
|
||||
ostr << std::string(100, 'x');
|
||||
ostr.close();
|
||||
int rc = ph.wait();
|
||||
int POCO_UNUSED rc = ph.wait();
|
||||
assert (!Process::isRunning(ph));
|
||||
assert (!Process::isRunning(id));
|
||||
#endif // !defined(_WIN32_WCE)
|
||||
|
||||
@@ -102,9 +102,9 @@ void SimpleHashTableTest::testSize()
|
||||
{
|
||||
SimpleHashTable<std::string, int> hashTable(13);
|
||||
assert (hashTable.size() == 0);
|
||||
Poco::UInt32 h1 = hashTable.insert("1", 1);
|
||||
Poco::UInt32 POCO_UNUSED h1 = hashTable.insert("1", 1);
|
||||
assert (hashTable.size() == 1);
|
||||
Poco::UInt32 h2 = hashTable.update("2", 2);
|
||||
Poco::UInt32 POCO_UNUSED h2 = hashTable.update("2", 2);
|
||||
assert (hashTable.size() == 2);
|
||||
hashTable.clear();
|
||||
assert (hashTable.size() == 0);
|
||||
|
||||
@@ -378,14 +378,14 @@ void StringTokenizerTest::testFind()
|
||||
|
||||
try
|
||||
{
|
||||
std::size_t p = st.find("4");
|
||||
std::size_t POCO_UNUSED p = st.find("4");
|
||||
fail ("must fail");
|
||||
}
|
||||
catch (NotFoundException&) { }
|
||||
|
||||
try
|
||||
{
|
||||
std::string s = st[8];
|
||||
std::string POCO_UNUSED s = st[8];
|
||||
fail ("must fail");
|
||||
}
|
||||
catch (RangeException&) { }
|
||||
|
||||
@@ -88,16 +88,16 @@ void TypeListTest::testTypeList()
|
||||
TypeGetter<8, Type15>::HeadType,
|
||||
TypeGetter<9, Type15>::HeadType> tuple;
|
||||
|
||||
static TypeLocator<Type15, Int8> pos0;
|
||||
static TypeLocator<Type15, UInt8> pos1;
|
||||
static TypeLocator<Type15, Int16> pos2;
|
||||
static TypeLocator<Type15, UInt16> pos3;
|
||||
static TypeLocator<Type15, Int32> pos4;
|
||||
static TypeLocator<Type15, UInt32> pos5;
|
||||
static TypeLocator<Type15, float> pos6;
|
||||
static TypeLocator<Type15, double> pos7;
|
||||
static TypeLocator<Type15, Int8> pos8;
|
||||
static TypeLocator<Type15, std::string> posUnknown;
|
||||
static POCO_UNUSED TypeLocator<Type15, Int8> pos0;
|
||||
static POCO_UNUSED TypeLocator<Type15, UInt8> pos1;
|
||||
static POCO_UNUSED TypeLocator<Type15, Int16> pos2;
|
||||
static POCO_UNUSED TypeLocator<Type15, UInt16> pos3;
|
||||
static POCO_UNUSED TypeLocator<Type15, Int32> pos4;
|
||||
static POCO_UNUSED TypeLocator<Type15, UInt32> pos5;
|
||||
static POCO_UNUSED TypeLocator<Type15, float> pos6;
|
||||
static POCO_UNUSED TypeLocator<Type15, double> pos7;
|
||||
static POCO_UNUSED TypeLocator<Type15, Int8> pos8;
|
||||
static POCO_UNUSED TypeLocator<Type15, std::string> posUnknown;
|
||||
|
||||
assert (pos0.value == 0);
|
||||
assert (pos1.value == 1);
|
||||
@@ -155,9 +155,9 @@ void TypeListTest::testTypeList()
|
||||
assert (typeid(TypeGetter<1, Type3>::HeadType) == typeid(Int16));
|
||||
assert (typeid(TypeGetter<2, Type3>::HeadType) == typeid(Int32));
|
||||
|
||||
static TypeLocator<Type3, Int8> posNo1;
|
||||
static TypeLocator<Type3, Int16> posNo2;
|
||||
static TypeLocator<Type3, Int32> posNo3;
|
||||
static POCO_UNUSED TypeLocator<Type3, Int8> posNo1;
|
||||
static POCO_UNUSED TypeLocator<Type3, Int16> posNo2;
|
||||
static POCO_UNUSED TypeLocator<Type3, Int32> posNo3;
|
||||
|
||||
assert (posNo1.value == 0);
|
||||
assert (posNo2.value == 1);
|
||||
|
||||
@@ -128,7 +128,7 @@ void VarTest::testInt8()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -216,7 +216,7 @@ void VarTest::testInt16()
|
||||
|
||||
try
|
||||
{
|
||||
Int32 value2; value2 = a1.extract<Int32>();
|
||||
Int32 POCO_UNUSED value2; value2 = a1.extract<Int32>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -304,7 +304,7 @@ void VarTest::testInt32()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -392,7 +392,7 @@ void VarTest::testInt64()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -480,7 +480,7 @@ void VarTest::testUInt8()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -568,7 +568,7 @@ void VarTest::testUInt16()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -656,7 +656,7 @@ void VarTest::testUInt32()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -744,7 +744,7 @@ void VarTest::testUInt64()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -832,7 +832,7 @@ void VarTest::testBool()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -903,7 +903,7 @@ void VarTest::testChar()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -915,7 +915,7 @@ void VarTest::testChar()
|
||||
void VarTest::testFloat()
|
||||
{
|
||||
Var any("0");
|
||||
float f = any;
|
||||
float POCO_UNUSED f = any;
|
||||
|
||||
float src = 32.0f;
|
||||
Var a1 = src;
|
||||
@@ -977,7 +977,7 @@ void VarTest::testFloat()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -1007,7 +1007,7 @@ void VarTest::testDouble()
|
||||
{
|
||||
double d = 0;
|
||||
Var v(d);
|
||||
float f = v;
|
||||
float POCO_UNUSED f = v;
|
||||
|
||||
double src = 32.0;
|
||||
Var a1 = src;
|
||||
@@ -1069,7 +1069,7 @@ void VarTest::testDouble()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -1153,7 +1153,7 @@ void VarTest::testString()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -1242,7 +1242,7 @@ void VarTest::testLong()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -1330,7 +1330,7 @@ void VarTest::testULong()
|
||||
|
||||
try
|
||||
{
|
||||
Int16 value2; value2 = a1.extract<Int16>();
|
||||
Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
|
||||
fail("bad cast - must throw");
|
||||
}
|
||||
catch (Poco::BadCastException&)
|
||||
@@ -1371,7 +1371,7 @@ void VarTest::testUDT()
|
||||
|
||||
try
|
||||
{
|
||||
float f = da1;
|
||||
float POCO_UNUSED f = da1;
|
||||
fail ("must fail");
|
||||
}
|
||||
catch (BadCastException&) { }
|
||||
@@ -1712,12 +1712,12 @@ void VarTest::testLimitsFloat()
|
||||
{
|
||||
double iMin = -1 * std::numeric_limits<float>::max();
|
||||
Var da = iMin * 10;
|
||||
try { float f; f = da; fail("must fail"); }
|
||||
try { float POCO_UNUSED f; f = da; fail("must fail"); }
|
||||
catch (RangeException&) {}
|
||||
|
||||
double iMax = std::numeric_limits<float>::max();
|
||||
da = iMax * 10;
|
||||
try { float f; f = da; fail("must fail"); }
|
||||
try { float POCO_UNUSED f; f = da; fail("must fail"); }
|
||||
catch (RangeException&) {}
|
||||
}
|
||||
}
|
||||
@@ -2539,13 +2539,13 @@ void VarTest::testEmpty()
|
||||
|
||||
try
|
||||
{
|
||||
int i = da;
|
||||
int POCO_UNUSED i = da;
|
||||
fail ("must fail");
|
||||
} catch (InvalidAccessException&) { }
|
||||
|
||||
try
|
||||
{
|
||||
int i = da.extract<int>();
|
||||
int POCO_UNUSED i = da.extract<int>();
|
||||
fail ("must fail");
|
||||
} catch (InvalidAccessException&) { }
|
||||
}
|
||||
|
||||
@@ -97,12 +97,12 @@ private:
|
||||
{
|
||||
TL iMin = std::numeric_limits<TS>::min();
|
||||
Poco::Dynamic::Var da = iMin - 1;
|
||||
try { TS i; i = da.convert<TS>(); fail("must fail"); }
|
||||
try { TS POCO_UNUSED i; i = da.convert<TS>(); fail("must fail"); }
|
||||
catch (Poco::RangeException&) {}
|
||||
|
||||
TL iMax = std::numeric_limits<TS>::max();
|
||||
da = iMax + 1;
|
||||
try { TS i; i = da.convert<TS>(); fail("must fail"); }
|
||||
try { TS POCO_UNUSED i; i = da.convert<TS>(); fail("must fail"); }
|
||||
catch (Poco::RangeException&) {}
|
||||
}
|
||||
|
||||
@@ -115,13 +115,13 @@ private:
|
||||
{
|
||||
TL iMin = static_cast<TL>(std::numeric_limits<TS>::min());
|
||||
da = iMin * 10;
|
||||
try { TS i; i = da.convert<TS>(); fail("must fail"); }
|
||||
try { TS POCO_UNUSED i; i = da.convert<TS>(); fail("must fail"); }
|
||||
catch (Poco::RangeException&) {}
|
||||
}
|
||||
|
||||
TL iMax = static_cast<TL>(std::numeric_limits<TS>::max());
|
||||
da = iMax * 10;
|
||||
try { TS i; i = da.convert<TS>(); fail("must fail"); }
|
||||
try { TS POCO_UNUSED i; i = da.convert<TS>(); fail("must fail"); }
|
||||
catch (Poco::RangeException&) {}
|
||||
}
|
||||
|
||||
@@ -133,14 +133,14 @@ private:
|
||||
|
||||
TS iMin = std::numeric_limits<TS>::min();
|
||||
Poco::Dynamic::Var dMin = iMin;
|
||||
try { TU i; i = dMin.convert<TU>(); fail("must fail"); }
|
||||
try { TU POCO_UNUSED i; i = dMin.convert<TU>(); fail("must fail"); }
|
||||
catch (Poco::RangeException&) {}
|
||||
|
||||
if(sizeof(TS) == sizeof(TU))
|
||||
{
|
||||
TU iMax = std::numeric_limits<TU>::max();
|
||||
Poco::Dynamic::Var dMax = iMax;
|
||||
try { TS i; i = dMax.convert<TS>(); fail("must fail"); }
|
||||
try { TS POCO_UNUSED i; i = dMax.convert<TS>(); fail("must fail"); }
|
||||
catch (Poco::RangeException&) {}
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@ private:
|
||||
{
|
||||
TL iMax = std::numeric_limits<TS>::max();
|
||||
Poco::Dynamic::Var da = iMax + 1;
|
||||
try { TS i; i = da.convert<TS>(); fail("must fail"); }
|
||||
try { TS POCO_UNUSED i; i = da.convert<TS>(); fail("must fail"); }
|
||||
catch (Poco::RangeException&) {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user