mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-23 18:47:12 +02:00
Update POCO library.
This commit is contained in:
48
vendor/POCO/Util/testsuite/src/OptionTest.cpp
vendored
48
vendor/POCO/Util/testsuite/src/OptionTest.cpp
vendored
@ -34,11 +34,11 @@ void OptionTest::testOption()
|
||||
.required(false)
|
||||
.repeatable(true)
|
||||
.argument("path");
|
||||
|
||||
|
||||
Option libOpt = Option("library-dir", "L", "specify a library search path", false)
|
||||
.repeatable(true)
|
||||
.argument("path");
|
||||
|
||||
|
||||
Option outOpt = Option("output", "o", "specify the output file", true)
|
||||
.argument("file", true);
|
||||
|
||||
@ -46,13 +46,13 @@ void OptionTest::testOption()
|
||||
.description("enable verbose mode")
|
||||
.required(false)
|
||||
.repeatable(false);
|
||||
|
||||
|
||||
Option optOpt = Option("optimize", "O")
|
||||
.description("enable optimization")
|
||||
.required(false)
|
||||
.repeatable(false)
|
||||
.argument("level", false);
|
||||
|
||||
|
||||
assertTrue (incOpt.shortName() == "I");
|
||||
assertTrue (incOpt.fullName() == "include-dir");
|
||||
assertTrue (incOpt.repeatable());
|
||||
@ -60,7 +60,7 @@ void OptionTest::testOption()
|
||||
assertTrue (incOpt.argumentName() == "path");
|
||||
assertTrue (incOpt.argumentRequired());
|
||||
assertTrue (incOpt.takesArgument());
|
||||
|
||||
|
||||
assertTrue (libOpt.shortName() == "L");
|
||||
assertTrue (libOpt.fullName() == "library-dir");
|
||||
assertTrue (libOpt.repeatable());
|
||||
@ -100,7 +100,7 @@ void OptionTest::testMatches1()
|
||||
.required(false)
|
||||
.repeatable(true)
|
||||
.argument("path");
|
||||
|
||||
|
||||
assertTrue (incOpt.matchesShort("Iinclude"));
|
||||
assertTrue (incOpt.matchesPartial("include:include"));
|
||||
assertTrue (incOpt.matchesPartial("include-dir:include"));
|
||||
@ -109,12 +109,12 @@ void OptionTest::testMatches1()
|
||||
assertTrue (incOpt.matchesPartial("include"));
|
||||
assertTrue (incOpt.matchesShort("I"));
|
||||
assertTrue (incOpt.matchesPartial("i"));
|
||||
|
||||
|
||||
assertTrue (incOpt.matchesFull("include-dir:include"));
|
||||
assertTrue (incOpt.matchesFull("INClude-dir:include"));
|
||||
assertTrue (!incOpt.matchesFull("include:include"));
|
||||
assertTrue (!incOpt.matchesFull("include-dir2:include"));
|
||||
|
||||
|
||||
assertTrue (!incOpt.matchesPartial("include-dir2=include"));
|
||||
assertTrue (!incOpt.matchesShort("linclude"));
|
||||
}
|
||||
@ -126,7 +126,7 @@ void OptionTest::testMatches2()
|
||||
.required(false)
|
||||
.repeatable(true)
|
||||
.argument("path");
|
||||
|
||||
|
||||
assertTrue (!incOpt.matchesShort("Iinclude"));
|
||||
assertTrue (incOpt.matchesPartial("include:include"));
|
||||
assertTrue (incOpt.matchesPartial("include-dir:include"));
|
||||
@ -134,12 +134,12 @@ void OptionTest::testMatches2()
|
||||
assertTrue (incOpt.matchesPartial("INCLUDE=include"));
|
||||
assertTrue (incOpt.matchesPartial("I"));
|
||||
assertTrue (incOpt.matchesPartial("i"));
|
||||
|
||||
|
||||
assertTrue (incOpt.matchesFull("include-dir:include"));
|
||||
assertTrue (incOpt.matchesFull("INClude-dir:include"));
|
||||
assertTrue (!incOpt.matchesFull("include:include"));
|
||||
assertTrue (!incOpt.matchesFull("include-dir2:include"));
|
||||
|
||||
|
||||
assertTrue (!incOpt.matchesFull("include-dir2=include"));
|
||||
assertTrue (!incOpt.matchesShort("linclude"));
|
||||
}
|
||||
@ -165,7 +165,7 @@ void OptionTest::testProcess1()
|
||||
assertTrue (arg == "/usr/include");
|
||||
incOpt.process("Include-dir:/proj/include", arg);
|
||||
assertTrue (arg == "/proj/include");
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
incOpt.process("I", arg);
|
||||
@ -183,7 +183,7 @@ void OptionTest::testProcess1()
|
||||
catch (Poco::Util::MissingArgumentException&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
incOpt.process("Llib", arg);
|
||||
@ -192,17 +192,17 @@ void OptionTest::testProcess1()
|
||||
catch (Poco::Util::UnknownOptionException&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Option vrbOpt = Option("verbose", "v")
|
||||
.description("enable verbose mode")
|
||||
.required(false)
|
||||
.repeatable(false);
|
||||
|
||||
|
||||
vrbOpt.process("v", arg);
|
||||
assertTrue (arg.empty());
|
||||
vrbOpt.process("verbose", arg);
|
||||
assertTrue (arg.empty());
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
vrbOpt.process("v2", arg);
|
||||
@ -220,13 +220,13 @@ void OptionTest::testProcess1()
|
||||
catch (Poco::Util::UnexpectedArgumentException&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Option optOpt = Option("optimize", "O")
|
||||
.description("enable optimization")
|
||||
.required(false)
|
||||
.repeatable(false)
|
||||
.argument("level", false);
|
||||
|
||||
|
||||
optOpt.process("O", arg);
|
||||
assertTrue (arg.empty());
|
||||
optOpt.process("O2", arg);
|
||||
@ -258,7 +258,7 @@ void OptionTest::testProcess2()
|
||||
assertTrue (arg == "/usr/include");
|
||||
incOpt.process("Include-dir:/proj/include", arg);
|
||||
assertTrue (arg == "/proj/include");
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
incOpt.process("Iinclude", arg);
|
||||
@ -267,7 +267,7 @@ void OptionTest::testProcess2()
|
||||
catch (Poco::Util::UnknownOptionException&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
incOpt.process("I", arg);
|
||||
@ -285,7 +285,7 @@ void OptionTest::testProcess2()
|
||||
catch (Poco::Util::MissingArgumentException&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
incOpt.process("Llib", arg);
|
||||
@ -294,17 +294,17 @@ void OptionTest::testProcess2()
|
||||
catch (Poco::Util::UnknownOptionException&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Option vrbOpt = Option("verbose", "")
|
||||
.description("enable verbose mode")
|
||||
.required(false)
|
||||
.repeatable(false);
|
||||
|
||||
|
||||
vrbOpt.process("v", arg);
|
||||
assertTrue (arg.empty());
|
||||
vrbOpt.process("verbose", arg);
|
||||
assertTrue (arg.empty());
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
vrbOpt.process("v2", arg);
|
||||
|
Reference in New Issue
Block a user