summaryrefslogtreecommitdiff
path: root/cpp/tests/ConfigurationTest.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2006-12-06 08:11:57 +0000
committerGordon Sim <gsim@apache.org>2006-12-06 08:11:57 +0000
commit905c59a988010c9db7f64ee90f9d0b6e1011f0d0 (patch)
tree60bfef5035aea1284d1d216de2c57ebd8ba9063f /cpp/tests/ConfigurationTest.cpp
parent7ece6a3212f401f5ce298e01728f939e670dc4d9 (diff)
downloadqpid-python-905c59a988010c9db7f64ee90f9d0b6e1011f0d0.tar.gz
Patch sumbitted to qpid-dev:
2006-12-05 Jim Meyering <meyering@redhat.com> Improve --help output. Add --version option. * lib/broker/Configuration.cpp: Include <config.h>. (Configuration::Configuration): Use the active voice. Handle --version. (Configuration::usage): Add Usage:... and bug-reporting address. Output short+long options like "-o, --option ...", so that help2man will format them properly. * lib/broker/Configuration.h: (class Configuration) [version, programName]: New members. (parse): Update prototype. (isVersion, setValue): New prototypes. * src/qpidd.cpp: Include <config.h>. (programName): New file-scoped global. (handle_signal, main): Emit diagnostics to stderr. (main): Pass program name to config.parse. (main): Handle new --version option. Also updated ConfigurationTest to use the modified parse() method. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@482958 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/tests/ConfigurationTest.cpp')
-rw-r--r--cpp/tests/ConfigurationTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/cpp/tests/ConfigurationTest.cpp b/cpp/tests/ConfigurationTest.cpp
index 2b308f45cf..c2c8eb6f32 100644
--- a/cpp/tests/ConfigurationTest.cpp
+++ b/cpp/tests/ConfigurationTest.cpp
@@ -41,7 +41,7 @@ class ConfigurationTest : public CppUnit::TestCase
{
Configuration conf;
char* argv[] = {"ignore", "--help"};
- conf.parse(2, argv);
+ conf.parse("ignore", 2, argv);
CPPUNIT_ASSERT(conf.isHelp());
}
@@ -49,7 +49,7 @@ class ConfigurationTest : public CppUnit::TestCase
{
Configuration conf;
char* argv[] = {"ignore", "--port", "6789"};
- conf.parse(3, argv);
+ conf.parse("ignore", 3, argv);
CPPUNIT_ASSERT_EQUAL(6789, conf.getPort());
}
@@ -57,7 +57,7 @@ class ConfigurationTest : public CppUnit::TestCase
{
Configuration conf;
char* argv[] = {"ignore", "-p", "6789"};
- conf.parse(3, argv);
+ conf.parse("ignore", 3, argv);
CPPUNIT_ASSERT_EQUAL(6789, conf.getPort());
}
@@ -65,7 +65,7 @@ class ConfigurationTest : public CppUnit::TestCase
{
Configuration conf;
char* argv[] = {"ignore", "--store", "my-store-module.so"};
- conf.parse(3, argv);
+ conf.parse("ignore", 3, argv);
std::string expected("my-store-module.so");
CPPUNIT_ASSERT_EQUAL(expected, conf.getStore());
}
@@ -74,7 +74,7 @@ class ConfigurationTest : public CppUnit::TestCase
{
Configuration conf;
char* argv[] = {"ignore", "-t", "--worker-threads", "10"};
- conf.parse(4, argv);
+ conf.parse("ignore", 4, argv);
CPPUNIT_ASSERT_EQUAL(5672, conf.getPort());//default
CPPUNIT_ASSERT_EQUAL(10, conf.getWorkerThreads());
CPPUNIT_ASSERT(conf.isTrace());