Revert "GH #1050 Util tests: fix gcc -Wshadow warnings"

This commit is contained in:
Günter Obiltschnig 2016-09-05 08:27:13 +02:00 committed by GitHub
parent ffbdf4fbea
commit 1683dd18ae
20 changed files with 87 additions and 87 deletions

View File

@ -22,7 +22,7 @@
namespace Poco { namespace Poco {
Token::Token(bool isIgnore) : _ignored(isIgnore) Token::Token(bool ignore) : _ignored(ignore)
{ {
} }
@ -94,9 +94,9 @@ char Token::asChar() const
} }
void Token::ignore(bool isIgnored) void Token::ignore(bool ignored)
{ {
_ignored = isIgnored; _ignored = ignored;
} }
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& rName): CppUnit::TestCase("JSON") JSONTest::JSONTest(const std::string& name): CppUnit::TestCase("JSON")
{ {
} }

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ using Poco::Util::AbstractConfiguration;
using Poco::AutoPtr; using Poco::AutoPtr;
FilesystemConfigurationTest::FilesystemConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName), FilesystemConfigurationTest::FilesystemConfigurationTest(const std::string& name): AbstractConfigurationTest(name),
_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& rName): CppUnit::TestCase(rName) HelpFormatterTest::HelpFormatterTest(const std::string& name): CppUnit::TestCase(name)
{ {
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ using Poco::Util::OptionSet;
using Poco::Util::OptionProcessor; using Poco::Util::OptionProcessor;
OptionProcessorTest::OptionProcessorTest(const std::string& rName): CppUnit::TestCase(rName) OptionProcessorTest::OptionProcessorTest(const std::string& name): CppUnit::TestCase(name)
{ {
} }
@ -81,58 +81,58 @@ void OptionProcessorTest::testUnix()
.repeatable(false)); .repeatable(false));
OptionProcessor p1(set); OptionProcessor p1(set);
std::string optionName; std::string name;
std::string value; std::string value;
assert (p1.process("-I/usr/include", optionName, value)); assert (p1.process("-I/usr/include", name, value));
assert (optionName == "include-dir"); assert (name == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("--include:/usr/local/include", optionName, value)); assert (p1.process("--include:/usr/local/include", name, value));
assert (optionName == "include-dir"); assert (name == "include-dir");
assert (value == "/usr/local/include"); assert (value == "/usr/local/include");
assert (p1.process("-I", optionName, value)); assert (p1.process("-I", name, value));
assert (optionName.empty()); assert (name.empty());
assert (value.empty()); assert (value.empty());
assert (p1.process("/usr/include", optionName, value)); assert (p1.process("/usr/include", name, value));
assert (optionName == "include-dir"); assert (name == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("-I", optionName, value)); assert (p1.process("-I", name, value));
assert (optionName.empty()); assert (name.empty());
assert (value.empty()); assert (value.empty());
assert (p1.process("-L", optionName, value)); assert (p1.process("-L", name, value));
assert (optionName == "include-dir"); assert (name == "include-dir");
assert (value == "-L"); assert (value == "-L");
assert (p1.process("--lib=/usr/local/lib", optionName, value)); assert (p1.process("--lib=/usr/local/lib", name, value));
assert (optionName == "library-dir"); assert (name == "library-dir");
assert (value == "/usr/local/lib"); assert (value == "/usr/local/lib");
assert (p1.process("-ofile", optionName, value)); assert (p1.process("-ofile", name, value));
assert (optionName == "output"); assert (name == "output");
assert (value == "file"); assert (value == "file");
assert (!p1.process("src/file.cpp", optionName, value)); assert (!p1.process("src/file.cpp", name, value));
assert (!p1.process("/src/file.cpp", optionName, value)); assert (!p1.process("/src/file.cpp", name, value));
try try
{ {
p1.process("--output:file", optionName, value); p1.process("--output:file", name, value);
fail("duplicate - must throw"); fail("duplicate - must throw");
} }
catch (Poco::Util::DuplicateOptionException&) catch (Poco::Util::DuplicateOptionException&)
{ {
} }
assert (p1.process("-g", optionName, value)); assert (p1.process("-g", name, value));
assert (optionName == "debug"); assert (name == "debug");
assert (value == ""); assert (value == "");
try try
{ {
p1.process("--optimize", optionName, value); p1.process("--optimize", name, 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", optionName, value); p1.process("-x", name, 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", optionName, value); p1.process("--in", name, 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 optionName; std::string name;
std::string value; std::string value;
assert (p1.process("/Inc:/usr/include", optionName, value)); assert (p1.process("/Inc:/usr/include", name, value));
assert (optionName == "include-dir"); assert (name == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("/include:/usr/local/include", optionName, value)); assert (p1.process("/include:/usr/local/include", name, value));
assert (optionName == "include-dir"); assert (name == "include-dir");
assert (value == "/usr/local/include"); assert (value == "/usr/local/include");
assert (p1.process("/Inc", optionName, value)); assert (p1.process("/Inc", name, value));
assert (optionName.empty()); assert (name.empty());
assert (value.empty()); assert (value.empty());
assert (p1.process("/usr/include", optionName, value)); assert (p1.process("/usr/include", name, value));
assert (optionName == "include-dir"); assert (name == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("/lib=/usr/local/lib", optionName, value)); assert (p1.process("/lib=/usr/local/lib", name, value));
assert (optionName == "library-dir"); assert (name == "library-dir");
assert (value == "/usr/local/lib"); assert (value == "/usr/local/lib");
assert (p1.process("/out:file", optionName, value)); assert (p1.process("/out:file", name, value));
assert (optionName == "output"); assert (name == "output");
assert (value == "file"); assert (value == "file");
assert (!p1.process("src/file.cpp", optionName, value)); assert (!p1.process("src/file.cpp", name, value));
assert (!p1.process("\\src\\file.cpp", optionName, value)); assert (!p1.process("\\src\\file.cpp", name, value));
try try
{ {
p1.process("/output:file", optionName, value); p1.process("/output:file", name, value);
fail("duplicate - must throw"); fail("duplicate - must throw");
} }
catch (Poco::Util::DuplicateOptionException&) catch (Poco::Util::DuplicateOptionException&)
{ {
} }
assert (p1.process("/debug", optionName, value)); assert (p1.process("/debug", name, value));
assert (optionName == "debug"); assert (name == "debug");
assert (value == ""); assert (value == "");
try try
{ {
p1.process("/OPT", optionName, value); p1.process("/OPT", name, 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", optionName, value); p1.process("/x", name, 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", optionName, value); p1.process("/in", name, 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 optionName; std::string name;
std::string value; std::string value;
try try
@ -299,7 +299,7 @@ void OptionProcessorTest::testRequired()
{ {
} }
assert (p1.process("-o", optionName, value)); assert (p1.process("-o", name, 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 optionName; std::string name;
std::string value; std::string value;
assert (p1.process("-I/usr/include", optionName, value)); assert (p1.process("-I/usr/include", name, value));
assert (optionName == "include-dir"); assert (name == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("--include:/usr/local/include", optionName, value)); assert (p1.process("--include:/usr/local/include", name, value));
assert (optionName == "include-dir"); assert (name == "include-dir");
assert (value == "/usr/local/include"); assert (value == "/usr/local/include");
assert (p1.process("-I", optionName, value)); assert (p1.process("-I", name, value));
assert (optionName.empty()); assert (name.empty());
assert (value.empty()); assert (value.empty());
assert (p1.process("/usr/include", optionName, value)); assert (p1.process("/usr/include", name, value));
assert (optionName == "include-dir"); assert (name == "include-dir");
assert (value == "/usr/include"); assert (value == "/usr/include");
assert (p1.process("-I", optionName, value)); assert (p1.process("-I", name, value));
assert (optionName.empty()); assert (name.empty());
assert (value.empty()); assert (value.empty());
assert (p1.process("-L", optionName, value)); assert (p1.process("-L", name, value));
assert (optionName == "include-dir"); assert (name == "include-dir");
assert (value == "-L"); assert (value == "-L");
assert (p1.process("-O", optionName, value)); assert (p1.process("-O", name, value));
assert (optionName == "optimize"); assert (name == "optimize");
assert (value.empty()); assert (value.empty());
assert (p1.process("-O2", optionName, value)); assert (p1.process("-O2", name, value));
assert (optionName == "optimize"); assert (name == "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& rName): CppUnit::TestCase(rName) OptionSetTest::OptionSetTest(const std::string& name): CppUnit::TestCase(name)
{ {
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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