mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-16 19:54:38 +01:00
GH #1050 Util tests: fix gcc -Wshadow warnings
This commit is contained in:
parent
34e415cdd9
commit
4421048c78
@ -22,7 +22,7 @@
|
||||
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
|
||||
|
@ -35,7 +35,7 @@ using Poco::DynamicStruct;
|
||||
using Poco::DateTime;
|
||||
using Poco::DateTimeFormatter;
|
||||
|
||||
JSONTest::JSONTest(const std::string& name): CppUnit::TestCase("JSON")
|
||||
JSONTest::JSONTest(const std::string& rName): CppUnit::TestCase("JSON")
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ using Poco::Int64;
|
||||
using Poco::UInt64;
|
||||
|
||||
|
||||
AbstractConfigurationTest::AbstractConfigurationTest(const std::string& name): CppUnit::TestCase(name)
|
||||
AbstractConfigurationTest::AbstractConfigurationTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ using Poco::Util::MapConfiguration;
|
||||
using Poco::AutoPtr;
|
||||
|
||||
|
||||
ConfigurationMapperTest::ConfigurationMapperTest(const std::string& name): AbstractConfigurationTest(name)
|
||||
ConfigurationMapperTest::ConfigurationMapperTest(const std::string& rName): AbstractConfigurationTest(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ using Poco::Util::MapConfiguration;
|
||||
using Poco::AutoPtr;
|
||||
|
||||
|
||||
ConfigurationViewTest::ConfigurationViewTest(const std::string& name): AbstractConfigurationTest(name)
|
||||
ConfigurationViewTest::ConfigurationViewTest(const std::string& rName): AbstractConfigurationTest(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ using Poco::Util::AbstractConfiguration;
|
||||
using Poco::AutoPtr;
|
||||
|
||||
|
||||
FilesystemConfigurationTest::FilesystemConfigurationTest(const std::string& name): AbstractConfigurationTest(name),
|
||||
FilesystemConfigurationTest::FilesystemConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName),
|
||||
_path("TestConfiguration")
|
||||
{
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ using Poco::Util::OptionSet;
|
||||
using Poco::Util::HelpFormatter;
|
||||
|
||||
|
||||
HelpFormatterTest::HelpFormatterTest(const std::string& name): CppUnit::TestCase(name)
|
||||
HelpFormatterTest::HelpFormatterTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ using Poco::NotImplementedException;
|
||||
using Poco::NotFoundException;
|
||||
|
||||
|
||||
IniFileConfigurationTest::IniFileConfigurationTest(const std::string& name): AbstractConfigurationTest(name)
|
||||
IniFileConfigurationTest::IniFileConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ using Poco::NotFoundException;
|
||||
using Poco::JSON::JSONException;
|
||||
|
||||
|
||||
JSONConfigurationTest::JSONConfigurationTest(const std::string& name) : AbstractConfigurationTest(name)
|
||||
JSONConfigurationTest::JSONConfigurationTest(const std::string& rName) : AbstractConfigurationTest(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ using Poco::NotFoundException;
|
||||
using Poco::RuntimeException;
|
||||
|
||||
|
||||
LayeredConfigurationTest::LayeredConfigurationTest(const std::string& name): AbstractConfigurationTest(name)
|
||||
LayeredConfigurationTest::LayeredConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ using Poco::Message;
|
||||
using Poco::AutoPtr;
|
||||
|
||||
|
||||
LoggingConfiguratorTest::LoggingConfiguratorTest(const std::string& name): CppUnit::TestCase(name)
|
||||
LoggingConfiguratorTest::LoggingConfiguratorTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ using Poco::Util::MapConfiguration;
|
||||
using Poco::AutoPtr;
|
||||
|
||||
|
||||
MapConfigurationTest::MapConfigurationTest(const std::string& name): AbstractConfigurationTest(name)
|
||||
MapConfigurationTest::MapConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ using Poco::Util::OptionSet;
|
||||
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));
|
||||
|
||||
OptionProcessor p1(set);
|
||||
std::string name;
|
||||
std::string optionName;
|
||||
std::string value;
|
||||
|
||||
assert (p1.process("-I/usr/include", name, value));
|
||||
assert (name == "include-dir");
|
||||
assert (p1.process("-I/usr/include", optionName, value));
|
||||
assert (optionName == "include-dir");
|
||||
assert (value == "/usr/include");
|
||||
|
||||
assert (p1.process("--include:/usr/local/include", name, value));
|
||||
assert (name == "include-dir");
|
||||
assert (p1.process("--include:/usr/local/include", optionName, value));
|
||||
assert (optionName == "include-dir");
|
||||
assert (value == "/usr/local/include");
|
||||
|
||||
assert (p1.process("-I", name, value));
|
||||
assert (name.empty());
|
||||
assert (p1.process("-I", optionName, value));
|
||||
assert (optionName.empty());
|
||||
assert (value.empty());
|
||||
assert (p1.process("/usr/include", name, value));
|
||||
assert (name == "include-dir");
|
||||
assert (p1.process("/usr/include", optionName, value));
|
||||
assert (optionName == "include-dir");
|
||||
assert (value == "/usr/include");
|
||||
|
||||
assert (p1.process("-I", name, value));
|
||||
assert (name.empty());
|
||||
assert (p1.process("-I", optionName, value));
|
||||
assert (optionName.empty());
|
||||
assert (value.empty());
|
||||
assert (p1.process("-L", name, value));
|
||||
assert (name == "include-dir");
|
||||
assert (p1.process("-L", optionName, value));
|
||||
assert (optionName == "include-dir");
|
||||
assert (value == "-L");
|
||||
|
||||
assert (p1.process("--lib=/usr/local/lib", name, value));
|
||||
assert (name == "library-dir");
|
||||
assert (p1.process("--lib=/usr/local/lib", optionName, value));
|
||||
assert (optionName == "library-dir");
|
||||
assert (value == "/usr/local/lib");
|
||||
|
||||
assert (p1.process("-ofile", name, value));
|
||||
assert (name == "output");
|
||||
assert (p1.process("-ofile", optionName, value));
|
||||
assert (optionName == "output");
|
||||
assert (value == "file");
|
||||
|
||||
assert (!p1.process("src/file.cpp", name, value));
|
||||
assert (!p1.process("/src/file.cpp", name, value));
|
||||
assert (!p1.process("src/file.cpp", optionName, value));
|
||||
assert (!p1.process("/src/file.cpp", optionName, value));
|
||||
|
||||
try
|
||||
{
|
||||
p1.process("--output:file", name, value);
|
||||
p1.process("--output:file", optionName, value);
|
||||
fail("duplicate - must throw");
|
||||
}
|
||||
catch (Poco::Util::DuplicateOptionException&)
|
||||
{
|
||||
}
|
||||
|
||||
assert (p1.process("-g", name, value));
|
||||
assert (name == "debug");
|
||||
assert (p1.process("-g", optionName, value));
|
||||
assert (optionName == "debug");
|
||||
assert (value == "");
|
||||
|
||||
try
|
||||
{
|
||||
p1.process("--optimize", name, value);
|
||||
p1.process("--optimize", optionName, value);
|
||||
fail("incompatible - must throw");
|
||||
}
|
||||
catch (Poco::Util::IncompatibleOptionsException&)
|
||||
@ -141,7 +141,7 @@ void OptionProcessorTest::testUnix()
|
||||
|
||||
try
|
||||
{
|
||||
p1.process("-x", name, value);
|
||||
p1.process("-x", optionName, value);
|
||||
fail("unknown option - must throw");
|
||||
}
|
||||
catch (Poco::Util::UnknownOptionException&)
|
||||
@ -150,7 +150,7 @@ void OptionProcessorTest::testUnix()
|
||||
|
||||
try
|
||||
{
|
||||
p1.process("--in", name, value);
|
||||
p1.process("--in", optionName, value);
|
||||
fail("ambiguous option - must throw");
|
||||
}
|
||||
catch (Poco::Util::AmbiguousOptionException&)
|
||||
@ -207,51 +207,51 @@ void OptionProcessorTest::testDefault()
|
||||
|
||||
OptionProcessor p1(set);
|
||||
p1.setUnixStyle(false);
|
||||
std::string name;
|
||||
std::string optionName;
|
||||
std::string value;
|
||||
|
||||
assert (p1.process("/Inc:/usr/include", name, value));
|
||||
assert (name == "include-dir");
|
||||
assert (p1.process("/Inc:/usr/include", optionName, value));
|
||||
assert (optionName == "include-dir");
|
||||
assert (value == "/usr/include");
|
||||
|
||||
assert (p1.process("/include:/usr/local/include", name, value));
|
||||
assert (name == "include-dir");
|
||||
assert (p1.process("/include:/usr/local/include", optionName, value));
|
||||
assert (optionName == "include-dir");
|
||||
assert (value == "/usr/local/include");
|
||||
|
||||
assert (p1.process("/Inc", name, value));
|
||||
assert (name.empty());
|
||||
assert (p1.process("/Inc", optionName, value));
|
||||
assert (optionName.empty());
|
||||
assert (value.empty());
|
||||
assert (p1.process("/usr/include", name, value));
|
||||
assert (name == "include-dir");
|
||||
assert (p1.process("/usr/include", optionName, value));
|
||||
assert (optionName == "include-dir");
|
||||
assert (value == "/usr/include");
|
||||
|
||||
assert (p1.process("/lib=/usr/local/lib", name, value));
|
||||
assert (name == "library-dir");
|
||||
assert (p1.process("/lib=/usr/local/lib", optionName, value));
|
||||
assert (optionName == "library-dir");
|
||||
assert (value == "/usr/local/lib");
|
||||
|
||||
assert (p1.process("/out:file", name, value));
|
||||
assert (name == "output");
|
||||
assert (p1.process("/out:file", optionName, value));
|
||||
assert (optionName == "output");
|
||||
assert (value == "file");
|
||||
|
||||
assert (!p1.process("src/file.cpp", name, value));
|
||||
assert (!p1.process("\\src\\file.cpp", name, value));
|
||||
assert (!p1.process("src/file.cpp", optionName, value));
|
||||
assert (!p1.process("\\src\\file.cpp", optionName, value));
|
||||
|
||||
try
|
||||
{
|
||||
p1.process("/output:file", name, value);
|
||||
p1.process("/output:file", optionName, value);
|
||||
fail("duplicate - must throw");
|
||||
}
|
||||
catch (Poco::Util::DuplicateOptionException&)
|
||||
{
|
||||
}
|
||||
|
||||
assert (p1.process("/debug", name, value));
|
||||
assert (name == "debug");
|
||||
assert (p1.process("/debug", optionName, value));
|
||||
assert (optionName == "debug");
|
||||
assert (value == "");
|
||||
|
||||
try
|
||||
{
|
||||
p1.process("/OPT", name, value);
|
||||
p1.process("/OPT", optionName, value);
|
||||
fail("incompatible - must throw");
|
||||
}
|
||||
catch (Poco::Util::IncompatibleOptionsException&)
|
||||
@ -260,7 +260,7 @@ void OptionProcessorTest::testDefault()
|
||||
|
||||
try
|
||||
{
|
||||
p1.process("/x", name, value);
|
||||
p1.process("/x", optionName, value);
|
||||
fail("unknown option - must throw");
|
||||
}
|
||||
catch (Poco::Util::UnknownOptionException&)
|
||||
@ -269,7 +269,7 @@ void OptionProcessorTest::testDefault()
|
||||
|
||||
try
|
||||
{
|
||||
p1.process("/in", name, value);
|
||||
p1.process("/in", optionName, value);
|
||||
fail("ambiguous option - must throw");
|
||||
}
|
||||
catch (Poco::Util::AmbiguousOptionException&)
|
||||
@ -287,7 +287,7 @@ void OptionProcessorTest::testRequired()
|
||||
.repeatable(true));
|
||||
|
||||
OptionProcessor p1(set);
|
||||
std::string name;
|
||||
std::string optionName;
|
||||
std::string value;
|
||||
|
||||
try
|
||||
@ -299,7 +299,7 @@ void OptionProcessorTest::testRequired()
|
||||
{
|
||||
}
|
||||
|
||||
assert (p1.process("-o", name, value));
|
||||
assert (p1.process("-o", optionName, value));
|
||||
p1.checkRequired();
|
||||
}
|
||||
|
||||
@ -321,37 +321,37 @@ void OptionProcessorTest::testArgs()
|
||||
.argument("level", false));
|
||||
|
||||
OptionProcessor p1(set);
|
||||
std::string name;
|
||||
std::string optionName;
|
||||
std::string value;
|
||||
|
||||
assert (p1.process("-I/usr/include", name, value));
|
||||
assert (name == "include-dir");
|
||||
assert (p1.process("-I/usr/include", optionName, value));
|
||||
assert (optionName == "include-dir");
|
||||
assert (value == "/usr/include");
|
||||
|
||||
assert (p1.process("--include:/usr/local/include", name, value));
|
||||
assert (name == "include-dir");
|
||||
assert (p1.process("--include:/usr/local/include", optionName, value));
|
||||
assert (optionName == "include-dir");
|
||||
assert (value == "/usr/local/include");
|
||||
|
||||
assert (p1.process("-I", name, value));
|
||||
assert (name.empty());
|
||||
assert (p1.process("-I", optionName, value));
|
||||
assert (optionName.empty());
|
||||
assert (value.empty());
|
||||
assert (p1.process("/usr/include", name, value));
|
||||
assert (name == "include-dir");
|
||||
assert (p1.process("/usr/include", optionName, value));
|
||||
assert (optionName == "include-dir");
|
||||
assert (value == "/usr/include");
|
||||
|
||||
assert (p1.process("-I", name, value));
|
||||
assert (name.empty());
|
||||
assert (p1.process("-I", optionName, value));
|
||||
assert (optionName.empty());
|
||||
assert (value.empty());
|
||||
assert (p1.process("-L", name, value));
|
||||
assert (name == "include-dir");
|
||||
assert (p1.process("-L", optionName, value));
|
||||
assert (optionName == "include-dir");
|
||||
assert (value == "-L");
|
||||
|
||||
assert (p1.process("-O", name, value));
|
||||
assert (name == "optimize");
|
||||
assert (p1.process("-O", optionName, value));
|
||||
assert (optionName == "optimize");
|
||||
assert (value.empty());
|
||||
|
||||
assert (p1.process("-O2", name, value));
|
||||
assert (name == "optimize");
|
||||
assert (p1.process("-O2", optionName, value));
|
||||
assert (optionName == "optimize");
|
||||
assert (value == "2");
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ using Poco::Util::OptionSet;
|
||||
using Poco::Util::Option;
|
||||
|
||||
|
||||
OptionSetTest::OptionSetTest(const std::string& name): CppUnit::TestCase(name)
|
||||
OptionSetTest::OptionSetTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
using Poco::Util::Option;
|
||||
|
||||
|
||||
OptionTest::OptionTest(const std::string& name): CppUnit::TestCase(name)
|
||||
OptionTest::OptionTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ using Poco::AutoPtr;
|
||||
using Poco::NotFoundException;
|
||||
|
||||
|
||||
PropertyFileConfigurationTest::PropertyFileConfigurationTest(const std::string& name): AbstractConfigurationTest(name)
|
||||
PropertyFileConfigurationTest::PropertyFileConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ using Poco::InvalidAccessException;
|
||||
using Poco::NotFoundException;
|
||||
|
||||
|
||||
SystemConfigurationTest::SystemConfigurationTest(const std::string& name): CppUnit::TestCase(name)
|
||||
SystemConfigurationTest::SystemConfigurationTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ using Poco::Timestamp;
|
||||
using Poco::Clock;
|
||||
|
||||
|
||||
TimerTest::TimerTest(const std::string& name): CppUnit::TestCase(name)
|
||||
TimerTest::TimerTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ using Poco::Util::InvalidArgumentException;
|
||||
using Poco::AutoPtr;
|
||||
|
||||
|
||||
ValidatorTest::ValidatorTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ValidatorTest::ValidatorTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ using Poco::NotImplementedException;
|
||||
using Poco::NotFoundException;
|
||||
|
||||
|
||||
XMLConfigurationTest::XMLConfigurationTest(const std::string& name): AbstractConfigurationTest(name)
|
||||
XMLConfigurationTest::XMLConfigurationTest(const std::string& rName): AbstractConfigurationTest(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user