From 056a4110835f3010aa61eba31dfba61bb9eb769c Mon Sep 17 00:00:00 2001 From: Alex Fabijanic Date: Sat, 7 Oct 2017 13:47:42 -0500 Subject: [PATCH] individually disable g++ unused warnings --- Foundation/testsuite/src/AnyTest.cpp | 2 +- Foundation/testsuite/src/ClassLoaderTest.cpp | 8 ++-- Foundation/testsuite/src/CoreTest.cpp | 18 ++++---- Foundation/testsuite/src/DateTimeTest.cpp | 22 +++++----- Foundation/testsuite/src/FileTest.cpp | 14 +++--- Foundation/testsuite/src/HashMapTest.cpp | 2 +- Foundation/testsuite/src/HashTableTest.cpp | 4 +- Foundation/testsuite/src/ListMapTest.cpp | 18 ++++---- .../testsuite/src/LoggingRegistryTest.cpp | 4 +- Foundation/testsuite/src/NamedTuplesTest.cpp | 40 ++++++++--------- Foundation/testsuite/src/ProcessTest.cpp | 2 +- .../testsuite/src/SimpleHashTableTest.cpp | 4 +- .../testsuite/src/StringTokenizerTest.cpp | 4 +- Foundation/testsuite/src/TypeListTest.cpp | 26 +++++------ Foundation/testsuite/src/VarTest.cpp | 44 +++++++++---------- Foundation/testsuite/src/VarTest.h | 14 +++--- 16 files changed, 113 insertions(+), 113 deletions(-) diff --git a/Foundation/testsuite/src/AnyTest.cpp b/Foundation/testsuite/src/AnyTest.cpp index 31c474872..468db91b6 100644 --- a/Foundation/testsuite/src/AnyTest.cpp +++ b/Foundation/testsuite/src/AnyTest.cpp @@ -227,7 +227,7 @@ void AnyTest::testInt() std::string* s = AnyCast(&a); assert (s == NULL); - int tmp = AnyCast(a); + int POCO_UNUSED tmp = AnyCast(a); const Any c = a; tmp = AnyCast(a); } diff --git a/Foundation/testsuite/src/ClassLoaderTest.cpp b/Foundation/testsuite/src/ClassLoaderTest.cpp index 82cf848bb..6ea707fbe 100644 --- a/Foundation/testsuite/src/ClassLoaderTest.cpp +++ b/Foundation/testsuite/src/ClassLoaderTest.cpp @@ -50,7 +50,7 @@ void ClassLoaderTest::testClassLoader1() try { - const ClassLoader::Meta& meta = cl.classFor("PluginA"); + const ClassLoader::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::Manif& manif = cl.manifestFor(path); + const ClassLoader::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&) diff --git a/Foundation/testsuite/src/CoreTest.cpp b/Foundation/testsuite/src/CoreTest.cpp index f5b1d5184..390189efd 100644 --- a/Foundation/testsuite/src/CoreTest.cpp +++ b/Foundation/testsuite/src/CoreTest.cpp @@ -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&) diff --git a/Foundation/testsuite/src/DateTimeTest.cpp b/Foundation/testsuite/src/DateTimeTest.cpp index e40348f00..c2e723482 100644 --- a/Foundation/testsuite/src/DateTimeTest.cpp +++ b/Foundation/testsuite/src/DateTimeTest.cpp @@ -643,21 +643,21 @@ 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 year = data[di].d_year; - const unsigned int day = data[di].d_day; + const int POCO_UNUSED line = data[di].d_lineNum; + const int year = data[di].d_year; + 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 // 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 // but cppUnit is not able to do this. @@ -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; + DateTime 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 diff --git a/Foundation/testsuite/src/FileTest.cpp b/Foundation/testsuite/src/FileTest.cpp index e10279b6d..8141b371d 100644 --- a/Foundation/testsuite/src/FileTest.cpp +++ b/Foundation/testsuite/src/FileTest.cpp @@ -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&) diff --git a/Foundation/testsuite/src/HashMapTest.cpp b/Foundation/testsuite/src/HashMapTest.cpp index 6250fb25b..33382432a 100644 --- a/Foundation/testsuite/src/HashMapTest.cpp +++ b/Foundation/testsuite/src/HashMapTest.cpp @@ -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&) diff --git a/Foundation/testsuite/src/HashTableTest.cpp b/Foundation/testsuite/src/HashTableTest.cpp index e2f6646e1..be4835d4c 100644 --- a/Foundation/testsuite/src/HashTableTest.cpp +++ b/Foundation/testsuite/src/HashTableTest.cpp @@ -102,9 +102,9 @@ void HashTableTest::testSize() { HashTable 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); diff --git a/Foundation/testsuite/src/ListMapTest.cpp b/Foundation/testsuite/src/ListMapTest.cpp index ce63bb907..6d9bbf380 100644 --- a/Foundation/testsuite/src/ListMapTest.cpp +++ b/Foundation/testsuite/src/ListMapTest.cpp @@ -72,20 +72,20 @@ void ListMapTest::testInsert() void ListMapTest::testInsertOrder() { - const int N = 1000; + const int POCO_UNUSED N = 1000; typedef ListMap StrToIntMap; StrToIntMap lm; lm.insert(StrToIntMap::ValueType("foo", 42)); lm.insert(StrToIntMap::ValueType("bar", 43)); - + StrToIntMap::Iterator it = lm.begin(); assert (it != lm.end() && it->first == "foo" && it->second == 42); - + ++it; assert (it != lm.end() && it->first == "bar" && it->second == 43); - + ++it; assert (it == lm.end()); @@ -93,13 +93,13 @@ void ListMapTest::testInsertOrder() it = lm.begin(); assert (it != lm.end() && it->first == "foo" && it->second == 42); - + ++it; assert (it != lm.end() && it->first == "foo" && it->second == 44); ++it; assert (it != lm.end() && it->first == "bar" && it->second == 43); - + ++it; assert (it == lm.end()); } @@ -213,16 +213,16 @@ void ListMapTest::testIntIndex() hm[1] = 2; hm[2] = 4; hm[3] = 6; - + assert (hm.size() == 3); assert (hm[1] == 2); assert (hm[2] == 4); assert (hm[3] == 6); - + try { const IntMap& im = hm; - int x = im[4]; + int POCO_UNUSED x = im[4]; fail("no such key - must throw"); } catch (Poco::NotFoundException&) diff --git a/Foundation/testsuite/src/LoggingRegistryTest.cpp b/Foundation/testsuite/src/LoggingRegistryTest.cpp index 74e800b35..7cc9a17bd 100644 --- a/Foundation/testsuite/src/LoggingRegistryTest.cpp +++ b/Foundation/testsuite/src/LoggingRegistryTest.cpp @@ -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&) diff --git a/Foundation/testsuite/src/NamedTuplesTest.cpp b/Foundation/testsuite/src/NamedTuplesTest.cpp index ff271ff6b..5c02ed17c 100644 --- a/Foundation/testsuite/src/NamedTuplesTest.cpp +++ b/Foundation/testsuite/src/NamedTuplesTest.cpp @@ -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); diff --git a/Foundation/testsuite/src/ProcessTest.cpp b/Foundation/testsuite/src/ProcessTest.cpp index dcbd54f0e..43d4cfecd 100644 --- a/Foundation/testsuite/src/ProcessTest.cpp +++ b/Foundation/testsuite/src/ProcessTest.cpp @@ -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) diff --git a/Foundation/testsuite/src/SimpleHashTableTest.cpp b/Foundation/testsuite/src/SimpleHashTableTest.cpp index 2df8c400d..c76584ee0 100644 --- a/Foundation/testsuite/src/SimpleHashTableTest.cpp +++ b/Foundation/testsuite/src/SimpleHashTableTest.cpp @@ -102,9 +102,9 @@ void SimpleHashTableTest::testSize() { SimpleHashTable 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); diff --git a/Foundation/testsuite/src/StringTokenizerTest.cpp b/Foundation/testsuite/src/StringTokenizerTest.cpp index 20559a485..927bdea9a 100644 --- a/Foundation/testsuite/src/StringTokenizerTest.cpp +++ b/Foundation/testsuite/src/StringTokenizerTest.cpp @@ -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&) { } diff --git a/Foundation/testsuite/src/TypeListTest.cpp b/Foundation/testsuite/src/TypeListTest.cpp index 2fb9ee72b..8b8e0fbb0 100644 --- a/Foundation/testsuite/src/TypeListTest.cpp +++ b/Foundation/testsuite/src/TypeListTest.cpp @@ -88,16 +88,16 @@ void TypeListTest::testTypeList() TypeGetter<8, Type15>::HeadType, TypeGetter<9, Type15>::HeadType> tuple; - static TypeLocator pos0; - static TypeLocator pos1; - static TypeLocator pos2; - static TypeLocator pos3; - static TypeLocator pos4; - static TypeLocator pos5; - static TypeLocator pos6; - static TypeLocator pos7; - static TypeLocator pos8; - static TypeLocator posUnknown; + static POCO_UNUSED TypeLocator pos0; + static POCO_UNUSED TypeLocator pos1; + static POCO_UNUSED TypeLocator pos2; + static POCO_UNUSED TypeLocator pos3; + static POCO_UNUSED TypeLocator pos4; + static POCO_UNUSED TypeLocator pos5; + static POCO_UNUSED TypeLocator pos6; + static POCO_UNUSED TypeLocator pos7; + static POCO_UNUSED TypeLocator pos8; + static POCO_UNUSED TypeLocator 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 posNo1; - static TypeLocator posNo2; - static TypeLocator posNo3; + static POCO_UNUSED TypeLocator posNo1; + static POCO_UNUSED TypeLocator posNo2; + static POCO_UNUSED TypeLocator posNo3; assert (posNo1.value == 0); assert (posNo2.value == 1); diff --git a/Foundation/testsuite/src/VarTest.cpp b/Foundation/testsuite/src/VarTest.cpp index 20d5d3cdf..64db03b34 100644 --- a/Foundation/testsuite/src/VarTest.cpp +++ b/Foundation/testsuite/src/VarTest.cpp @@ -128,7 +128,7 @@ void VarTest::testInt8() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -216,7 +216,7 @@ void VarTest::testInt16() try { - Int32 value2; value2 = a1.extract(); + Int32 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -304,7 +304,7 @@ void VarTest::testInt32() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -392,7 +392,7 @@ void VarTest::testInt64() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -480,7 +480,7 @@ void VarTest::testUInt8() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -568,7 +568,7 @@ void VarTest::testUInt16() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -656,7 +656,7 @@ void VarTest::testUInt32() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -744,7 +744,7 @@ void VarTest::testUInt64() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -832,7 +832,7 @@ void VarTest::testBool() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -903,7 +903,7 @@ void VarTest::testChar() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); 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 POCO_UNUSED value2; value2 = a1.extract(); 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 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -1153,7 +1153,7 @@ void VarTest::testString() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -1242,7 +1242,7 @@ void VarTest::testLong() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); fail("bad cast - must throw"); } catch (Poco::BadCastException&) @@ -1330,7 +1330,7 @@ void VarTest::testULong() try { - Int16 value2; value2 = a1.extract(); + Int16 POCO_UNUSED value2; value2 = a1.extract(); 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::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::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 POCO_UNUSED i = da.extract(); fail ("must fail"); } catch (InvalidAccessException&) { } } diff --git a/Foundation/testsuite/src/VarTest.h b/Foundation/testsuite/src/VarTest.h index b5c79abea..624d2cc7b 100644 --- a/Foundation/testsuite/src/VarTest.h +++ b/Foundation/testsuite/src/VarTest.h @@ -97,12 +97,12 @@ private: { TL iMin = std::numeric_limits::min(); Poco::Dynamic::Var da = iMin - 1; - try { TS i; i = da.convert(); fail("must fail"); } + try { TS POCO_UNUSED i; i = da.convert(); fail("must fail"); } catch (Poco::RangeException&) {} TL iMax = std::numeric_limits::max(); da = iMax + 1; - try { TS i; i = da.convert(); fail("must fail"); } + try { TS POCO_UNUSED i; i = da.convert(); fail("must fail"); } catch (Poco::RangeException&) {} } @@ -115,13 +115,13 @@ private: { TL iMin = static_cast(std::numeric_limits::min()); da = iMin * 10; - try { TS i; i = da.convert(); fail("must fail"); } + try { TS POCO_UNUSED i; i = da.convert(); fail("must fail"); } catch (Poco::RangeException&) {} } TL iMax = static_cast(std::numeric_limits::max()); da = iMax * 10; - try { TS i; i = da.convert(); fail("must fail"); } + try { TS POCO_UNUSED i; i = da.convert(); fail("must fail"); } catch (Poco::RangeException&) {} } @@ -133,14 +133,14 @@ private: TS iMin = std::numeric_limits::min(); Poco::Dynamic::Var dMin = iMin; - try { TU i; i = dMin.convert(); fail("must fail"); } + try { TU POCO_UNUSED i; i = dMin.convert(); fail("must fail"); } catch (Poco::RangeException&) {} if(sizeof(TS) == sizeof(TU)) { TU iMax = std::numeric_limits::max(); Poco::Dynamic::Var dMax = iMax; - try { TS i; i = dMax.convert(); fail("must fail"); } + try { TS POCO_UNUSED i; i = dMax.convert(); fail("must fail"); } catch (Poco::RangeException&) {} } } @@ -150,7 +150,7 @@ private: { TL iMax = std::numeric_limits::max(); Poco::Dynamic::Var da = iMax + 1; - try { TS i; i = da.convert(); fail("must fail"); } + try { TS POCO_UNUSED i; i = da.convert(); fail("must fail"); } catch (Poco::RangeException&) {} }