individually disable g++ unused warnings

This commit is contained in:
Alex Fabijanic
2017-10-07 13:47:42 -05:00
parent c7f105d1cd
commit 056a411083
16 changed files with 113 additions and 113 deletions

View File

@@ -227,7 +227,7 @@ void AnyTest::testInt()
std::string* s = AnyCast<std::string>(&a); std::string* s = AnyCast<std::string>(&a);
assert (s == NULL); assert (s == NULL);
int tmp = AnyCast<int>(a); int POCO_UNUSED tmp = AnyCast<int>(a);
const Any c = a; const Any c = a;
tmp = AnyCast<int>(a); tmp = AnyCast<int>(a);
} }

View File

@@ -50,7 +50,7 @@ void ClassLoaderTest::testClassLoader1()
try 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"); fail("not found - must throw exception");
} }
catch (NotFoundException&) catch (NotFoundException&)
@@ -63,7 +63,7 @@ void ClassLoaderTest::testClassLoader1()
try 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"); fail("not found - must throw exception");
} }
catch (NotFoundException&) catch (NotFoundException&)
@@ -122,7 +122,7 @@ void ClassLoaderTest::testClassLoader2()
try try
{ {
TestPlugin& plgB = cl.instance("PluginB"); TestPlugin& POCO_UNUSED plgB = cl.instance("PluginB");
fail("not a singleton - must throw"); fail("not a singleton - must throw");
} }
catch (InvalidAccessException&) catch (InvalidAccessException&)
@@ -131,7 +131,7 @@ void ClassLoaderTest::testClassLoader2()
try try
{ {
TestPlugin* pPluginC = cl.create("PluginC"); TestPlugin* POCO_UNUSED pPluginC = cl.create("PluginC");
fail("cannot create a singleton - must throw"); fail("cannot create a singleton - must throw");
} }
catch (InvalidAccessException&) catch (InvalidAccessException&)

View File

@@ -470,7 +470,7 @@ void CoreTest::testFIFOBufferChar()
assert ('7' == f[2]); assert ('7' == f[2]);
assert ('8' == f[3]); assert ('8' == f[3]);
assert ('9' == f[4]); assert ('9' == f[4]);
try { T i = f[10]; fail ("must fail"); } try { T POCO_UNUSED i = f[10]; fail ("must fail"); }
catch (InvalidAccessException&) { } catch (InvalidAccessException&) { }
v.clear(); v.clear();
@@ -498,7 +498,7 @@ void CoreTest::testFIFOBufferChar()
assert ('h' == f[12]); assert ('h' == f[12]);
assert ('i' == f[13]); assert ('i' == f[13]);
assert ('j' == f[14]); assert ('j' == f[14]);
try { T i = f[15]; fail ("must fail"); } try { T POCO_UNUSED i = f[15]; fail ("must fail"); }
catch (InvalidAccessException&) { } catch (InvalidAccessException&) { }
f.read(b, 10); f.read(b, 10);
@@ -510,7 +510,7 @@ void CoreTest::testFIFOBufferChar()
assert ('h' == f[2]); assert ('h' == f[2]);
assert ('i' == f[3]); assert ('i' == f[3]);
assert ('j' == f[4]); assert ('j' == f[4]);
try { T i = f[5]; fail ("must fail"); } try { T POCO_UNUSED i = f[5]; fail ("must fail"); }
catch (InvalidAccessException&) { } catch (InvalidAccessException&) { }
assert(1 == _notToReadable); assert(1 == _notToReadable);
@@ -526,7 +526,7 @@ void CoreTest::testFIFOBufferChar()
assert (5 == b.size()); assert (5 == b.size());
assert (20 == f.size()); assert (20 == f.size());
assert (0 == f.used()); assert (0 == f.used());
try { T i = f[0]; fail ("must fail"); } try { T POCO_UNUSED i = f[0]; fail ("must fail"); }
catch (InvalidAccessException&) { } catch (InvalidAccessException&) { }
assert (f.isEmpty()); assert (f.isEmpty());
@@ -797,7 +797,7 @@ void CoreTest::testFIFOBufferInt()
assert (7 == f[2]); assert (7 == f[2]);
assert (8 == f[3]); assert (8 == f[3]);
assert (9 == f[4]); assert (9 == f[4]);
try { T i = f[10]; fail ("must fail"); } try { T POCO_UNUSED i = f[10]; fail ("must fail"); }
catch (InvalidAccessException&) { } catch (InvalidAccessException&) { }
v.clear(); v.clear();
@@ -825,7 +825,7 @@ void CoreTest::testFIFOBufferInt()
assert (17 == f[12]); assert (17 == f[12]);
assert (18 == f[13]); assert (18 == f[13]);
assert (19 == f[14]); assert (19 == f[14]);
try { T i = f[15]; fail ("must fail"); } try { T POCO_UNUSED i = f[15]; fail ("must fail"); }
catch (InvalidAccessException&) { } catch (InvalidAccessException&) { }
f.read(b, 10); f.read(b, 10);
@@ -837,14 +837,14 @@ void CoreTest::testFIFOBufferInt()
assert (17 == f[2]); assert (17 == f[2]);
assert (18 == f[3]); assert (18 == f[3]);
assert (19 == f[4]); assert (19 == f[4]);
try { T i = f[5]; fail ("must fail"); } try { T POCO_UNUSED i = f[5]; fail ("must fail"); }
catch (InvalidAccessException&) { } catch (InvalidAccessException&) { }
f.read(b, 6); f.read(b, 6);
assert (5 == b.size()); assert (5 == b.size());
assert (20 == f.size()); assert (20 == f.size());
assert (0 == f.used()); assert (0 == f.used());
try { T i = f[0]; fail ("must fail"); } try { T POCO_UNUSED i = f[0]; fail ("must fail"); }
catch (InvalidAccessException&) { } catch (InvalidAccessException&) { }
assert (f.isEmpty()); assert (f.isEmpty());
@@ -987,7 +987,7 @@ void CoreTest::testNullable()
try try
{ {
int tmp = n1.value(); int POCO_UNUSED tmp = n1.value();
fail("null value, must throw"); fail("null value, must throw");
} }
catch (Poco::NullValueException&) catch (Poco::NullValueException&)

View File

@@ -643,21 +643,21 @@ void DateTimeTest::testSetYearDay()
const int num_data = sizeof data / sizeof *data; const int num_data = sizeof data / sizeof *data;
for (int di = 0; di < num_data; ++di) 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 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 int exp_month = data[di].d_expMonth;
const unsigned int exp_day = data[di].d_expDay; const unsigned int exp_day = data[di].d_expDay;
const DateTime r(year, exp_month, exp_day); const DateTime r(year, exp_month, exp_day);
DateTime x; DateTime x;
const DateTime& X = x; const DateTime& POCO_UNUSED X = x;
#if 0 #if 0
// TODO - need to be able to assign a day number in the year // TODO - need to be able to assign a day number in the year
// but POCO is not able to do this. // but POCO is not able to do this.
x.assign(year, day); x.assign(year, day);
// TODO - need to be able to assert with the loop counter // TODO - need to be able to assert with the loop counter
// but cppUnit is not able to do this. // but cppUnit is not able to do this.
@@ -696,16 +696,16 @@ void DateTimeTest::testSetYearDay()
const int num_data2 = sizeof data2 / sizeof *data2; const int num_data2 = sizeof data2 / sizeof *data2;
for (int di = 0; di < num_data2; ++di) for (int di = 0; di < num_data2; ++di)
{ {
const int line = data2[di].d_lineNum; const int POCO_UNUSED line = data2[di].d_lineNum;
const int year = data2[di].d_year; const int POCO_UNUSED year = data2[di].d_year;
const int day = data2[di].d_day; const int POCO_UNUSED day = data2[di].d_day;
const int exp = data2[di].d_exp; const int exp = data2[di].d_exp;
DateTime x; DateTime x;
const DateTime& X = x; const DateTime& POCO_UNUSED X = x;
if (1 == exp) if (1 == exp)
{ {
DateTime r; DateTime r;
const DateTime& r2 = r; const POCO_UNUSED DateTime& r2 = r;
#if 0 #if 0
r.set(year, day); r.set(year, day);
#endif #endif

View File

@@ -45,7 +45,7 @@ void FileTest::testFileAttributes1()
try try
{ {
bool flag = f.canRead(); bool POCO_UNUSED flag = f.canRead();
failmsg("file does not exist - must throw exception"); failmsg("file does not exist - must throw exception");
} }
catch (Exception&) catch (Exception&)
@@ -54,7 +54,7 @@ void FileTest::testFileAttributes1()
try try
{ {
bool flag = f.canWrite(); bool POCO_UNUSED flag = f.canWrite();
failmsg("file does not exist - must throw exception"); failmsg("file does not exist - must throw exception");
} }
catch (Exception&) catch (Exception&)
@@ -63,7 +63,7 @@ void FileTest::testFileAttributes1()
try try
{ {
bool flag = f.isFile(); bool POCO_UNUSED flag = f.isFile();
failmsg("file does not exist - must throw exception"); failmsg("file does not exist - must throw exception");
} }
catch (Exception&) catch (Exception&)
@@ -72,7 +72,7 @@ void FileTest::testFileAttributes1()
try try
{ {
bool flag = f.isDirectory(); bool POCO_UNUSED flag = f.isDirectory();
failmsg("file does not exist - must throw exception"); failmsg("file does not exist - must throw exception");
} }
catch (Exception&) catch (Exception&)
@@ -81,7 +81,7 @@ void FileTest::testFileAttributes1()
try try
{ {
Timestamp ts = f.created(); Timestamp POCO_UNUSED ts = f.created();
failmsg("file does not exist - must throw exception"); failmsg("file does not exist - must throw exception");
} }
catch (Exception&) catch (Exception&)
@@ -90,7 +90,7 @@ void FileTest::testFileAttributes1()
try try
{ {
Timestamp ts = f.getLastModified(); Timestamp POCO_UNUSED ts = f.getLastModified();
failmsg("file does not exist - must throw exception"); failmsg("file does not exist - must throw exception");
} }
catch (Exception&) catch (Exception&)
@@ -109,7 +109,7 @@ void FileTest::testFileAttributes1()
try try
{ {
File::FileSize fs = f.getSize(); File::FileSize POCO_UNUSED fs = f.getSize();
failmsg("file does not exist - must throw exception"); failmsg("file does not exist - must throw exception");
} }
catch (Exception&) catch (Exception&)

View File

@@ -189,7 +189,7 @@ void HashMapTest::testIndex()
try try
{ {
const IntMap& im = hm; const IntMap& im = hm;
int x = im[4]; int POCO_UNUSED x = im[4];
fail("no such key - must throw"); fail("no such key - must throw");
} }
catch (Poco::NotFoundException&) catch (Poco::NotFoundException&)

View File

@@ -102,9 +102,9 @@ void HashTableTest::testSize()
{ {
HashTable<std::string, int> hashTable(13); HashTable<std::string, int> hashTable(13);
assert (hashTable.size() == 0); assert (hashTable.size() == 0);
Poco::UInt32 h1 = hashTable.insert("1", 1); Poco::UInt32 POCO_UNUSED h1 = hashTable.insert("1", 1);
assert (hashTable.size() == 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); assert (hashTable.size() == 2);
hashTable.remove("1"); hashTable.remove("1");
assert (hashTable.size() == 1); assert (hashTable.size() == 1);

View File

@@ -72,20 +72,20 @@ void ListMapTest::testInsert()
void ListMapTest::testInsertOrder() void ListMapTest::testInsertOrder()
{ {
const int N = 1000; const int POCO_UNUSED N = 1000;
typedef ListMap<std::string, int> StrToIntMap; typedef ListMap<std::string, int> StrToIntMap;
StrToIntMap lm; StrToIntMap lm;
lm.insert(StrToIntMap::ValueType("foo", 42)); lm.insert(StrToIntMap::ValueType("foo", 42));
lm.insert(StrToIntMap::ValueType("bar", 43)); lm.insert(StrToIntMap::ValueType("bar", 43));
StrToIntMap::Iterator it = lm.begin(); StrToIntMap::Iterator it = lm.begin();
assert (it != lm.end() && it->first == "foo" && it->second == 42); assert (it != lm.end() && it->first == "foo" && it->second == 42);
++it; ++it;
assert (it != lm.end() && it->first == "bar" && it->second == 43); assert (it != lm.end() && it->first == "bar" && it->second == 43);
++it; ++it;
assert (it == lm.end()); assert (it == lm.end());
@@ -93,13 +93,13 @@ void ListMapTest::testInsertOrder()
it = lm.begin(); it = lm.begin();
assert (it != lm.end() && it->first == "foo" && it->second == 42); assert (it != lm.end() && it->first == "foo" && it->second == 42);
++it; ++it;
assert (it != lm.end() && it->first == "foo" && it->second == 44); assert (it != lm.end() && it->first == "foo" && it->second == 44);
++it; ++it;
assert (it != lm.end() && it->first == "bar" && it->second == 43); assert (it != lm.end() && it->first == "bar" && it->second == 43);
++it; ++it;
assert (it == lm.end()); assert (it == lm.end());
} }
@@ -213,16 +213,16 @@ void ListMapTest::testIntIndex()
hm[1] = 2; hm[1] = 2;
hm[2] = 4; hm[2] = 4;
hm[3] = 6; hm[3] = 6;
assert (hm.size() == 3); assert (hm.size() == 3);
assert (hm[1] == 2); assert (hm[1] == 2);
assert (hm[2] == 4); assert (hm[2] == 4);
assert (hm[3] == 6); assert (hm[3] == 6);
try try
{ {
const IntMap& im = hm; const IntMap& im = hm;
int x = im[4]; int POCO_UNUSED x = im[4];
fail("no such key - must throw"); fail("no such key - must throw");
} }
catch (Poco::NotFoundException&) catch (Poco::NotFoundException&)

View File

@@ -126,7 +126,7 @@ void LoggingRegistryTest::testUnregister()
try try
{ {
Channel* pC = reg.channelForName("c1"); Channel* POCO_UNUSED pC = reg.channelForName("c1");
fail("unregistered - must throw"); fail("unregistered - must throw");
} }
catch (Poco::NotFoundException&) catch (Poco::NotFoundException&)
@@ -135,7 +135,7 @@ void LoggingRegistryTest::testUnregister()
try try
{ {
Formatter* pF = reg.formatterForName("f2"); Formatter* POCO_UNUSED pF = reg.formatterForName("f2");
fail("unregistered - must throw"); fail("unregistered - must throw");
} }
catch (Poco::NotFoundException&) catch (Poco::NotFoundException&)

View File

@@ -50,7 +50,7 @@ void NamedTuplesTest::testNamedTuple1()
assert (aTuple["A"] == ""); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 1); assert (aTuple.length == 1);
@@ -86,7 +86,7 @@ void NamedTuplesTest::testNamedTuple2()
assert (aTuple["A"] == ""); assert (aTuple["A"] == "");
assert (aTuple["B"] == 0); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 2); assert (aTuple.length == 2);
@@ -128,7 +128,7 @@ void NamedTuplesTest::testNamedTuple3()
assert (aTuple["B"] == 0); assert (aTuple["B"] == 0);
assert (aTuple["C"] == false); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 3); assert (aTuple.length == 3);
@@ -174,7 +174,7 @@ void NamedTuplesTest::testNamedTuple4()
assert (aTuple["B"] == 0); assert (aTuple["B"] == 0);
assert (aTuple["C"] == false); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 4); assert (aTuple.length == 4);
@@ -224,7 +224,7 @@ void NamedTuplesTest::testNamedTuple5()
assert (aTuple["C"] == false); assert (aTuple["C"] == false);
assert (aTuple["E"] == 0); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 5); assert (aTuple.length == 5);
@@ -279,7 +279,7 @@ void NamedTuplesTest::testNamedTuple6()
assert (aTuple["E"] == 0); assert (aTuple["E"] == 0);
assert (aTuple["F"] == 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 6); assert (aTuple.length == 6);
@@ -338,7 +338,7 @@ void NamedTuplesTest::testNamedTuple7()
assert (aTuple["E"] == 0); assert (aTuple["E"] == 0);
assert (aTuple["F"] == 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 7); assert (aTuple.length == 7);
@@ -401,7 +401,7 @@ void NamedTuplesTest::testNamedTuple8()
assert (aTuple["F"] == 0); assert (aTuple["F"] == 0);
assert (aTuple["H"] == 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 8); assert (aTuple.length == 8);
@@ -470,7 +470,7 @@ void NamedTuplesTest::testNamedTuple9()
assert (aTuple["H"] == 0); assert (aTuple["H"] == 0);
assert (aTuple["I"] == ""); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 9); assert (aTuple.length == 9);
@@ -543,7 +543,7 @@ void NamedTuplesTest::testNamedTuple10()
assert (aTuple["I"] == ""); assert (aTuple["I"] == "");
assert (aTuple["J"] == 0); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 10); assert (aTuple.length == 10);
@@ -621,7 +621,7 @@ void NamedTuplesTest::testNamedTuple11()
assert (aTuple["J"] == 0); assert (aTuple["J"] == 0);
assert (aTuple["K"] == ""); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 11); assert (aTuple.length == 11);
@@ -704,7 +704,7 @@ void NamedTuplesTest::testNamedTuple12()
assert (aTuple["K"] == ""); assert (aTuple["K"] == "");
assert (aTuple["L"] == 0); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 12); assert (aTuple.length == 12);
@@ -791,7 +791,7 @@ void NamedTuplesTest::testNamedTuple13()
assert (aTuple["L"] == 0); assert (aTuple["L"] == 0);
assert (aTuple["M"] == false); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 13); assert (aTuple.length == 13);
@@ -881,7 +881,7 @@ void NamedTuplesTest::testNamedTuple14()
assert (aTuple["L"] == 0); assert (aTuple["L"] == 0);
assert (aTuple["M"] == false); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 14); assert (aTuple.length == 14);
@@ -975,7 +975,7 @@ void NamedTuplesTest::testNamedTuple15()
assert (aTuple["L"] == 0); assert (aTuple["L"] == 0);
assert (aTuple["M"] == false); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 15); assert (aTuple.length == 15);
@@ -1074,7 +1074,7 @@ void NamedTuplesTest::testNamedTuple16()
assert (aTuple["M"] == false); assert (aTuple["M"] == false);
assert (aTuple["O"] == 0); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 16); assert (aTuple.length == 16);
@@ -1179,7 +1179,7 @@ void NamedTuplesTest::testNamedTuple17()
assert (aTuple["O"] == 0); assert (aTuple["O"] == 0);
assert (aTuple["P"] == 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 17); assert (aTuple.length == 17);
@@ -1289,7 +1289,7 @@ void NamedTuplesTest::testNamedTuple18()
assert (aTuple["P"] == 0); assert (aTuple["P"] == 0);
assert (aTuple["R"] == 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 18); assert (aTuple.length == 18);
@@ -1404,7 +1404,7 @@ void NamedTuplesTest::testNamedTuple19()
assert (aTuple["R"] == 0); assert (aTuple["R"] == 0);
assert (aTuple["S"] == ""); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 19); assert (aTuple.length == 19);
@@ -1523,7 +1523,7 @@ void NamedTuplesTest::testNamedTuple20()
assert (aTuple["R"] == 0); assert (aTuple["R"] == 0);
assert (aTuple["S"] == ""); assert (aTuple["S"] == "");
assert (aTuple["T"] == 0); 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&) { } catch (NotFoundException&) { }
assert (aTuple.length == 20); assert (aTuple.length == 20);

View File

@@ -234,7 +234,7 @@ void ProcessTest::testIsRunning()
PipeOutputStream ostr(inPipe); PipeOutputStream ostr(inPipe);
ostr << std::string(100, 'x'); ostr << std::string(100, 'x');
ostr.close(); ostr.close();
int rc = ph.wait(); int POCO_UNUSED rc = ph.wait();
assert (!Process::isRunning(ph)); assert (!Process::isRunning(ph));
assert (!Process::isRunning(id)); assert (!Process::isRunning(id));
#endif // !defined(_WIN32_WCE) #endif // !defined(_WIN32_WCE)

View File

@@ -102,9 +102,9 @@ void SimpleHashTableTest::testSize()
{ {
SimpleHashTable<std::string, int> hashTable(13); SimpleHashTable<std::string, int> hashTable(13);
assert (hashTable.size() == 0); assert (hashTable.size() == 0);
Poco::UInt32 h1 = hashTable.insert("1", 1); Poco::UInt32 POCO_UNUSED h1 = hashTable.insert("1", 1);
assert (hashTable.size() == 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); assert (hashTable.size() == 2);
hashTable.clear(); hashTable.clear();
assert (hashTable.size() == 0); assert (hashTable.size() == 0);

View File

@@ -378,14 +378,14 @@ void StringTokenizerTest::testFind()
try try
{ {
std::size_t p = st.find("4"); std::size_t POCO_UNUSED p = st.find("4");
fail ("must fail"); fail ("must fail");
} }
catch (NotFoundException&) { } catch (NotFoundException&) { }
try try
{ {
std::string s = st[8]; std::string POCO_UNUSED s = st[8];
fail ("must fail"); fail ("must fail");
} }
catch (RangeException&) { } catch (RangeException&) { }

View File

@@ -88,16 +88,16 @@ void TypeListTest::testTypeList()
TypeGetter<8, Type15>::HeadType, TypeGetter<8, Type15>::HeadType,
TypeGetter<9, Type15>::HeadType> tuple; TypeGetter<9, Type15>::HeadType> tuple;
static TypeLocator<Type15, Int8> pos0; static POCO_UNUSED TypeLocator<Type15, Int8> pos0;
static TypeLocator<Type15, UInt8> pos1; static POCO_UNUSED TypeLocator<Type15, UInt8> pos1;
static TypeLocator<Type15, Int16> pos2; static POCO_UNUSED TypeLocator<Type15, Int16> pos2;
static TypeLocator<Type15, UInt16> pos3; static POCO_UNUSED TypeLocator<Type15, UInt16> pos3;
static TypeLocator<Type15, Int32> pos4; static POCO_UNUSED TypeLocator<Type15, Int32> pos4;
static TypeLocator<Type15, UInt32> pos5; static POCO_UNUSED TypeLocator<Type15, UInt32> pos5;
static TypeLocator<Type15, float> pos6; static POCO_UNUSED TypeLocator<Type15, float> pos6;
static TypeLocator<Type15, double> pos7; static POCO_UNUSED TypeLocator<Type15, double> pos7;
static TypeLocator<Type15, Int8> pos8; static POCO_UNUSED TypeLocator<Type15, Int8> pos8;
static TypeLocator<Type15, std::string> posUnknown; static POCO_UNUSED TypeLocator<Type15, std::string> posUnknown;
assert (pos0.value == 0); assert (pos0.value == 0);
assert (pos1.value == 1); assert (pos1.value == 1);
@@ -155,9 +155,9 @@ void TypeListTest::testTypeList()
assert (typeid(TypeGetter<1, Type3>::HeadType) == typeid(Int16)); assert (typeid(TypeGetter<1, Type3>::HeadType) == typeid(Int16));
assert (typeid(TypeGetter<2, Type3>::HeadType) == typeid(Int32)); assert (typeid(TypeGetter<2, Type3>::HeadType) == typeid(Int32));
static TypeLocator<Type3, Int8> posNo1; static POCO_UNUSED TypeLocator<Type3, Int8> posNo1;
static TypeLocator<Type3, Int16> posNo2; static POCO_UNUSED TypeLocator<Type3, Int16> posNo2;
static TypeLocator<Type3, Int32> posNo3; static POCO_UNUSED TypeLocator<Type3, Int32> posNo3;
assert (posNo1.value == 0); assert (posNo1.value == 0);
assert (posNo2.value == 1); assert (posNo2.value == 1);

View File

@@ -128,7 +128,7 @@ void VarTest::testInt8()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -216,7 +216,7 @@ void VarTest::testInt16()
try try
{ {
Int32 value2; value2 = a1.extract<Int32>(); Int32 POCO_UNUSED value2; value2 = a1.extract<Int32>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -304,7 +304,7 @@ void VarTest::testInt32()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -392,7 +392,7 @@ void VarTest::testInt64()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -480,7 +480,7 @@ void VarTest::testUInt8()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -568,7 +568,7 @@ void VarTest::testUInt16()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -656,7 +656,7 @@ void VarTest::testUInt32()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -744,7 +744,7 @@ void VarTest::testUInt64()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -832,7 +832,7 @@ void VarTest::testBool()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -903,7 +903,7 @@ void VarTest::testChar()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -915,7 +915,7 @@ void VarTest::testChar()
void VarTest::testFloat() void VarTest::testFloat()
{ {
Var any("0"); Var any("0");
float f = any; float POCO_UNUSED f = any;
float src = 32.0f; float src = 32.0f;
Var a1 = src; Var a1 = src;
@@ -977,7 +977,7 @@ void VarTest::testFloat()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -1007,7 +1007,7 @@ void VarTest::testDouble()
{ {
double d = 0; double d = 0;
Var v(d); Var v(d);
float f = v; float POCO_UNUSED f = v;
double src = 32.0; double src = 32.0;
Var a1 = src; Var a1 = src;
@@ -1069,7 +1069,7 @@ void VarTest::testDouble()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -1153,7 +1153,7 @@ void VarTest::testString()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -1242,7 +1242,7 @@ void VarTest::testLong()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -1330,7 +1330,7 @@ void VarTest::testULong()
try try
{ {
Int16 value2; value2 = a1.extract<Int16>(); Int16 POCO_UNUSED value2; value2 = a1.extract<Int16>();
fail("bad cast - must throw"); fail("bad cast - must throw");
} }
catch (Poco::BadCastException&) catch (Poco::BadCastException&)
@@ -1371,7 +1371,7 @@ void VarTest::testUDT()
try try
{ {
float f = da1; float POCO_UNUSED f = da1;
fail ("must fail"); fail ("must fail");
} }
catch (BadCastException&) { } catch (BadCastException&) { }
@@ -1712,12 +1712,12 @@ void VarTest::testLimitsFloat()
{ {
double iMin = -1 * std::numeric_limits<float>::max(); double iMin = -1 * std::numeric_limits<float>::max();
Var da = iMin * 10; Var da = iMin * 10;
try { float f; f = da; fail("must fail"); } try { float POCO_UNUSED f; f = da; fail("must fail"); }
catch (RangeException&) {} catch (RangeException&) {}
double iMax = std::numeric_limits<float>::max(); double iMax = std::numeric_limits<float>::max();
da = iMax * 10; da = iMax * 10;
try { float f; f = da; fail("must fail"); } try { float POCO_UNUSED f; f = da; fail("must fail"); }
catch (RangeException&) {} catch (RangeException&) {}
} }
} }
@@ -2539,13 +2539,13 @@ void VarTest::testEmpty()
try try
{ {
int i = da; int POCO_UNUSED i = da;
fail ("must fail"); fail ("must fail");
} catch (InvalidAccessException&) { } } catch (InvalidAccessException&) { }
try try
{ {
int i = da.extract<int>(); int POCO_UNUSED i = da.extract<int>();
fail ("must fail"); fail ("must fail");
} catch (InvalidAccessException&) { } } catch (InvalidAccessException&) { }
} }

View File

@@ -97,12 +97,12 @@ private:
{ {
TL iMin = std::numeric_limits<TS>::min(); TL iMin = std::numeric_limits<TS>::min();
Poco::Dynamic::Var da = iMin - 1; 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&) {} catch (Poco::RangeException&) {}
TL iMax = std::numeric_limits<TS>::max(); TL iMax = std::numeric_limits<TS>::max();
da = iMax + 1; 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&) {} catch (Poco::RangeException&) {}
} }
@@ -115,13 +115,13 @@ private:
{ {
TL iMin = static_cast<TL>(std::numeric_limits<TS>::min()); TL iMin = static_cast<TL>(std::numeric_limits<TS>::min());
da = iMin * 10; 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&) {} catch (Poco::RangeException&) {}
} }
TL iMax = static_cast<TL>(std::numeric_limits<TS>::max()); TL iMax = static_cast<TL>(std::numeric_limits<TS>::max());
da = iMax * 10; 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&) {} catch (Poco::RangeException&) {}
} }
@@ -133,14 +133,14 @@ private:
TS iMin = std::numeric_limits<TS>::min(); TS iMin = std::numeric_limits<TS>::min();
Poco::Dynamic::Var dMin = iMin; 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&) {} catch (Poco::RangeException&) {}
if(sizeof(TS) == sizeof(TU)) if(sizeof(TS) == sizeof(TU))
{ {
TU iMax = std::numeric_limits<TU>::max(); TU iMax = std::numeric_limits<TU>::max();
Poco::Dynamic::Var dMax = iMax; 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&) {} catch (Poco::RangeException&) {}
} }
} }
@@ -150,7 +150,7 @@ private:
{ {
TL iMax = std::numeric_limits<TS>::max(); TL iMax = std::numeric_limits<TS>::max();
Poco::Dynamic::Var da = iMax + 1; 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&) {} catch (Poco::RangeException&) {}
} }