GH #1050 Util tests: fix gcc -Wshadow warnings

This commit is contained in:
Miklos Vajna 2016-05-11 09:55:43 +02:00
parent 34e415cdd9
commit 4421048c78
20 changed files with 87 additions and 87 deletions

View File

@ -22,7 +22,7 @@
namespace Poco { namespace Poco {
Token::Token(bool ignore) : _ignored(ignore) Token::Token(bool isIgnore) : _ignored(isIgnore)
{ {
} }
@ -94,9 +94,9 @@ char Token::asChar() const
} }
void Token::ignore(bool ignored) void Token::ignore(bool isIgnored)
{ {
_ignored = ignored; _ignored = isIgnored;
} }
bool Token::ignored() const bool Token::ignored() const

View File

@ -35,7 +35,7 @@ using Poco::DynamicStruct;
using Poco::DateTime; using Poco::DateTime;
using Poco::DateTimeFormatter; using Poco::DateTimeFormatter;
JSONTest::JSONTest(const std::string& name): CppUnit::TestCase("JSON") JSONTest::JSONTest(const std::string& rName): CppUnit::TestCase("JSON")
{ {
} }

View File

@ -32,7 +32,7 @@ using Poco::Int64;
using Poco::UInt64; using Poco::UInt64;
AbstractConfigurationTest::AbstractConfigurationTest(const std::string& name): CppUnit::TestCase(name) AbstractConfigurationTest::AbstractConfigurationTest(const std::string& rName): CppUnit::TestCase(rName)
{ {
} }

View File

@ -26,7 +26,7 @@ using Poco::Util::MapConfiguration;
using Poco::AutoPtr; using Poco::AutoPtr;
ConfigurationMapperTest::ConfigurationMapperTest(const std::string& name): AbstractConfigurationTest(name) ConfigurationMapperTest::ConfigurationMapperTest(const std::string& rName): AbstractConfigurationTest(rName)
{ {
} }

View File

@ -24,7 +24,7 @@ using Poco::Util::MapConfiguration;
using Poco::AutoPtr; using Poco::AutoPtr;
ConfigurationViewTest::ConfigurationViewTest(const std::string& name): AbstractConfigurationTest(name) ConfigurationViewTest::ConfigurationViewTest(const std::string& rName): AbstractConfigurationTest(rName)
{ {
} }

View File

@ -24,7 +24,7 @@ using Poco::Util::AbstractConfiguration;
using Poco::AutoPtr; using Poco::AutoPtr;
FilesystemConfigurationTest::FilesystemConfigurationTest(const std::string& name): AbstractConfigurationTest(name), FilesystemConfigurationTest::FilesystemConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName),
_path("TestConfiguration") _path("TestConfiguration")
{ {
} }

View File

@ -24,7 +24,7 @@ using Poco::Util::OptionSet;
using Poco::Util::HelpFormatter; using Poco::Util::HelpFormatter;
HelpFormatterTest::HelpFormatterTest(const std::string& name): CppUnit::TestCase(name) HelpFormatterTest::HelpFormatterTest(const std::string& rName): CppUnit::TestCase(rName)
{ {
} }

View File

@ -27,7 +27,7 @@ using Poco::NotImplementedException;
using Poco::NotFoundException; using Poco::NotFoundException;
IniFileConfigurationTest::IniFileConfigurationTest(const std::string& name): AbstractConfigurationTest(name) IniFileConfigurationTest::IniFileConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName)
{ {
} }

View File

@ -25,7 +25,7 @@ using Poco::NotFoundException;
using Poco::JSON::JSONException; using Poco::JSON::JSONException;
JSONConfigurationTest::JSONConfigurationTest(const std::string& name) : AbstractConfigurationTest(name) JSONConfigurationTest::JSONConfigurationTest(const std::string& rName) : AbstractConfigurationTest(rName)
{ {
} }

View File

@ -28,7 +28,7 @@ using Poco::NotFoundException;
using Poco::RuntimeException; using Poco::RuntimeException;
LayeredConfigurationTest::LayeredConfigurationTest(const std::string& name): AbstractConfigurationTest(name) LayeredConfigurationTest::LayeredConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName)
{ {
} }

View File

@ -44,7 +44,7 @@ using Poco::Message;
using Poco::AutoPtr; using Poco::AutoPtr;
LoggingConfiguratorTest::LoggingConfiguratorTest(const std::string& name): CppUnit::TestCase(name) LoggingConfiguratorTest::LoggingConfiguratorTest(const std::string& rName): CppUnit::TestCase(rName)
{ {
} }

View File

@ -22,7 +22,7 @@ using Poco::Util::MapConfiguration;
using Poco::AutoPtr; using Poco::AutoPtr;
MapConfigurationTest::MapConfigurationTest(const std::string& name): AbstractConfigurationTest(name) MapConfigurationTest::MapConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName)
{ {
} }

View File

@ -24,7 +24,7 @@ using Poco::Util::OptionSet;
using Poco::Util::OptionProcessor; using Poco::Util::OptionProcessor;
OptionProcessorTest::OptionProcessorTest(const std::string& name): CppUnit::TestCase(name) OptionProcessorTest::OptionProcessorTest(const std::string& rName): CppUnit::TestCase(rName)
{ {
} }
@ -81,58 +81,58 @@ void OptionProcessorTest::testUnix()
.repeatable(false)); .repeatable(false));
OptionProcessor p1(set); OptionProcessor p1(set);
std::string name; std::string optionName;
std::string value; std::string value;
assert (p1.process("-I/usr/include", name, value)); assert (p1.process("-I/usr/include", optionName, value));
assert (name == "include-dir"); assert (optionName == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("--include:/usr/local/include", name, value)); assert (p1.process("--include:/usr/local/include", optionName, value));
assert (name == "include-dir"); assert (optionName == "include-dir");
assert (value == "/usr/local/include"); assert (value == "/usr/local/include");
assert (p1.process("-I", name, value)); assert (p1.process("-I", optionName, value));
assert (name.empty()); assert (optionName.empty());
assert (value.empty()); assert (value.empty());
assert (p1.process("/usr/include", name, value)); assert (p1.process("/usr/include", optionName, value));
assert (name == "include-dir"); assert (optionName == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("-I", name, value)); assert (p1.process("-I", optionName, value));
assert (name.empty()); assert (optionName.empty());
assert (value.empty()); assert (value.empty());
assert (p1.process("-L", name, value)); assert (p1.process("-L", optionName, value));
assert (name == "include-dir"); assert (optionName == "include-dir");
assert (value == "-L"); assert (value == "-L");
assert (p1.process("--lib=/usr/local/lib", name, value)); assert (p1.process("--lib=/usr/local/lib", optionName, value));
assert (name == "library-dir"); assert (optionName == "library-dir");
assert (value == "/usr/local/lib"); assert (value == "/usr/local/lib");
assert (p1.process("-ofile", name, value)); assert (p1.process("-ofile", optionName, value));
assert (name == "output"); assert (optionName == "output");
assert (value == "file"); assert (value == "file");
assert (!p1.process("src/file.cpp", name, value)); assert (!p1.process("src/file.cpp", optionName, value));
assert (!p1.process("/src/file.cpp", name, value)); assert (!p1.process("/src/file.cpp", optionName, value));
try try
{ {
p1.process("--output:file", name, value); p1.process("--output:file", optionName, value);
fail("duplicate - must throw"); fail("duplicate - must throw");
} }
catch (Poco::Util::DuplicateOptionException&) catch (Poco::Util::DuplicateOptionException&)
{ {
} }
assert (p1.process("-g", name, value)); assert (p1.process("-g", optionName, value));
assert (name == "debug"); assert (optionName == "debug");
assert (value == ""); assert (value == "");
try try
{ {
p1.process("--optimize", name, value); p1.process("--optimize", optionName, value);
fail("incompatible - must throw"); fail("incompatible - must throw");
} }
catch (Poco::Util::IncompatibleOptionsException&) catch (Poco::Util::IncompatibleOptionsException&)
@ -141,7 +141,7 @@ void OptionProcessorTest::testUnix()
try try
{ {
p1.process("-x", name, value); p1.process("-x", optionName, value);
fail("unknown option - must throw"); fail("unknown option - must throw");
} }
catch (Poco::Util::UnknownOptionException&) catch (Poco::Util::UnknownOptionException&)
@ -150,7 +150,7 @@ void OptionProcessorTest::testUnix()
try try
{ {
p1.process("--in", name, value); p1.process("--in", optionName, value);
fail("ambiguous option - must throw"); fail("ambiguous option - must throw");
} }
catch (Poco::Util::AmbiguousOptionException&) catch (Poco::Util::AmbiguousOptionException&)
@ -207,51 +207,51 @@ void OptionProcessorTest::testDefault()
OptionProcessor p1(set); OptionProcessor p1(set);
p1.setUnixStyle(false); p1.setUnixStyle(false);
std::string name; std::string optionName;
std::string value; std::string value;
assert (p1.process("/Inc:/usr/include", name, value)); assert (p1.process("/Inc:/usr/include", optionName, value));
assert (name == "include-dir"); assert (optionName == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("/include:/usr/local/include", name, value)); assert (p1.process("/include:/usr/local/include", optionName, value));
assert (name == "include-dir"); assert (optionName == "include-dir");
assert (value == "/usr/local/include"); assert (value == "/usr/local/include");
assert (p1.process("/Inc", name, value)); assert (p1.process("/Inc", optionName, value));
assert (name.empty()); assert (optionName.empty());
assert (value.empty()); assert (value.empty());
assert (p1.process("/usr/include", name, value)); assert (p1.process("/usr/include", optionName, value));
assert (name == "include-dir"); assert (optionName == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("/lib=/usr/local/lib", name, value)); assert (p1.process("/lib=/usr/local/lib", optionName, value));
assert (name == "library-dir"); assert (optionName == "library-dir");
assert (value == "/usr/local/lib"); assert (value == "/usr/local/lib");
assert (p1.process("/out:file", name, value)); assert (p1.process("/out:file", optionName, value));
assert (name == "output"); assert (optionName == "output");
assert (value == "file"); assert (value == "file");
assert (!p1.process("src/file.cpp", name, value)); assert (!p1.process("src/file.cpp", optionName, value));
assert (!p1.process("\\src\\file.cpp", name, value)); assert (!p1.process("\\src\\file.cpp", optionName, value));
try try
{ {
p1.process("/output:file", name, value); p1.process("/output:file", optionName, value);
fail("duplicate - must throw"); fail("duplicate - must throw");
} }
catch (Poco::Util::DuplicateOptionException&) catch (Poco::Util::DuplicateOptionException&)
{ {
} }
assert (p1.process("/debug", name, value)); assert (p1.process("/debug", optionName, value));
assert (name == "debug"); assert (optionName == "debug");
assert (value == ""); assert (value == "");
try try
{ {
p1.process("/OPT", name, value); p1.process("/OPT", optionName, value);
fail("incompatible - must throw"); fail("incompatible - must throw");
} }
catch (Poco::Util::IncompatibleOptionsException&) catch (Poco::Util::IncompatibleOptionsException&)
@ -260,7 +260,7 @@ void OptionProcessorTest::testDefault()
try try
{ {
p1.process("/x", name, value); p1.process("/x", optionName, value);
fail("unknown option - must throw"); fail("unknown option - must throw");
} }
catch (Poco::Util::UnknownOptionException&) catch (Poco::Util::UnknownOptionException&)
@ -269,7 +269,7 @@ void OptionProcessorTest::testDefault()
try try
{ {
p1.process("/in", name, value); p1.process("/in", optionName, value);
fail("ambiguous option - must throw"); fail("ambiguous option - must throw");
} }
catch (Poco::Util::AmbiguousOptionException&) catch (Poco::Util::AmbiguousOptionException&)
@ -287,7 +287,7 @@ void OptionProcessorTest::testRequired()
.repeatable(true)); .repeatable(true));
OptionProcessor p1(set); OptionProcessor p1(set);
std::string name; std::string optionName;
std::string value; std::string value;
try try
@ -299,7 +299,7 @@ void OptionProcessorTest::testRequired()
{ {
} }
assert (p1.process("-o", name, value)); assert (p1.process("-o", optionName, value));
p1.checkRequired(); p1.checkRequired();
} }
@ -321,37 +321,37 @@ void OptionProcessorTest::testArgs()
.argument("level", false)); .argument("level", false));
OptionProcessor p1(set); OptionProcessor p1(set);
std::string name; std::string optionName;
std::string value; std::string value;
assert (p1.process("-I/usr/include", name, value)); assert (p1.process("-I/usr/include", optionName, value));
assert (name == "include-dir"); assert (optionName == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("--include:/usr/local/include", name, value)); assert (p1.process("--include:/usr/local/include", optionName, value));
assert (name == "include-dir"); assert (optionName == "include-dir");
assert (value == "/usr/local/include"); assert (value == "/usr/local/include");
assert (p1.process("-I", name, value)); assert (p1.process("-I", optionName, value));
assert (name.empty()); assert (optionName.empty());
assert (value.empty()); assert (value.empty());
assert (p1.process("/usr/include", name, value)); assert (p1.process("/usr/include", optionName, value));
assert (name == "include-dir"); assert (optionName == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("-I", name, value)); assert (p1.process("-I", optionName, value));
assert (name.empty()); assert (optionName.empty());
assert (value.empty()); assert (value.empty());
assert (p1.process("-L", name, value)); assert (p1.process("-L", optionName, value));
assert (name == "include-dir"); assert (optionName == "include-dir");
assert (value == "-L"); assert (value == "-L");
assert (p1.process("-O", name, value)); assert (p1.process("-O", optionName, value));
assert (name == "optimize"); assert (optionName == "optimize");
assert (value.empty()); assert (value.empty());
assert (p1.process("-O2", name, value)); assert (p1.process("-O2", optionName, value));
assert (name == "optimize"); assert (optionName == "optimize");
assert (value == "2"); assert (value == "2");
} }

View File

@ -22,7 +22,7 @@ using Poco::Util::OptionSet;
using Poco::Util::Option; using Poco::Util::Option;
OptionSetTest::OptionSetTest(const std::string& name): CppUnit::TestCase(name) OptionSetTest::OptionSetTest(const std::string& rName): CppUnit::TestCase(rName)
{ {
} }

View File

@ -20,7 +20,7 @@
using Poco::Util::Option; using Poco::Util::Option;
OptionTest::OptionTest(const std::string& name): CppUnit::TestCase(name) OptionTest::OptionTest(const std::string& rName): CppUnit::TestCase(rName)
{ {
} }

View File

@ -26,7 +26,7 @@ using Poco::AutoPtr;
using Poco::NotFoundException; using Poco::NotFoundException;
PropertyFileConfigurationTest::PropertyFileConfigurationTest(const std::string& name): AbstractConfigurationTest(name) PropertyFileConfigurationTest::PropertyFileConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName)
{ {
} }

View File

@ -34,7 +34,7 @@ using Poco::InvalidAccessException;
using Poco::NotFoundException; using Poco::NotFoundException;
SystemConfigurationTest::SystemConfigurationTest(const std::string& name): CppUnit::TestCase(name) SystemConfigurationTest::SystemConfigurationTest(const std::string& rName): CppUnit::TestCase(rName)
{ {
} }

View File

@ -24,7 +24,7 @@ using Poco::Timestamp;
using Poco::Clock; using Poco::Clock;
TimerTest::TimerTest(const std::string& name): CppUnit::TestCase(name) TimerTest::TimerTest(const std::string& rName): CppUnit::TestCase(rName)
{ {
} }

View File

@ -28,7 +28,7 @@ using Poco::Util::InvalidArgumentException;
using Poco::AutoPtr; using Poco::AutoPtr;
ValidatorTest::ValidatorTest(const std::string& name): CppUnit::TestCase(name) ValidatorTest::ValidatorTest(const std::string& rName): CppUnit::TestCase(rName)
{ {
} }

View File

@ -27,7 +27,7 @@ using Poco::NotImplementedException;
using Poco::NotFoundException; using Poco::NotFoundException;
XMLConfigurationTest::XMLConfigurationTest(const std::string& name): AbstractConfigurationTest(name) XMLConfigurationTest::XMLConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName)
{ {
} }