[Positioning] Delete old option server.port

This option was replaced by input.udp-port.
This commit is contained in:
Matteo Cypriani 2011-03-29 12:32:26 +02:00
parent 1a5117d46b
commit 70ff9ffb42
3 changed files with 8 additions and 22 deletions

View File

@ -1,6 +1,8 @@
#include "userinterface.hh"
#include "configuration.hh"
#include <owlps.h>
#include <iostream>
#include <fstream>
#include <boost/program_options.hpp>
@ -13,7 +15,6 @@ namespace po = boost::program_options ;
/* *** Default value definitions *** */
#define DEFAULT_CONFIG_FILE_NAME "cfg/owlps-positioning.cfg"
#define DEFAULT_LISTENING_PORT 9902
@ -81,7 +82,6 @@ void UserInterface::fill_cli_options()
void UserInterface::fill_file_options()
{
fill_server_options() ;
fill_data_input_options() ;
fill_input_options() ;
fill_log_options() ;
@ -90,20 +90,6 @@ void UserInterface::fill_file_options()
}
void UserInterface::fill_server_options()
{
po::options_description options("Server options") ;
options.add_options()
("server.port,l", po::value<int>()
->default_value(DEFAULT_LISTENING_PORT),
"Server listening port.")
;
file_options->add(options) ;
}
void UserInterface::fill_data_input_options()
{
po::options_description options("Data input options") ;
@ -148,7 +134,8 @@ void UserInterface::fill_input_options()
"Medium from which requests are read. Allowed: CSV, UDP.")
("input.csv-file,C", po::value<string>(),
"CSV file to use for input (when input.medium = CSV).")
("input.udp-port,p", po::value<int>(),
("input.udp-port,p", po::value<int>()
->default_value(POSITIONER_DEFAULT_PORT),
"Port on which the UDP socket listens (when input.medium = UDP).")
;

View File

@ -24,7 +24,6 @@ protected:
/// \brief Fill in the options accepted on the command line and in
/// the configuration file
void fill_file_options(void) ;
void fill_server_options(void) ;
void fill_data_input_options(void) ;
void fill_input_options(void) ;
void fill_log_options(void) ;

View File

@ -21,9 +21,9 @@ public:
// Fill name and contents of the test config file
config_file_name = "/tmp/UserInterface_test_config_file.csv" ;
config_lines.push_back("\n") ;
config_lines.push_back("[server]\n") ;
config_lines.push_back("[input]\n") ;
config_lines.push_back("\n") ;
config_lines.push_back("port = 42\n") ;
config_lines.push_back("udp-port = 42\n") ;
config_lines.push_back("\n") ;
TestUtil::fill_file(config_file_name, config_lines) ;
@ -64,10 +64,10 @@ public:
UserInterface ui(argc, const_cast<char**>(argv)) ;
TS_ASSERT(Configuration::is_configured("server.port")) ;
TS_ASSERT(Configuration::is_configured("input.udp-port")) ;
TS_ASSERT(Configuration::is_configured("config-file")) ;
TS_ASSERT_EQUALS(Configuration::int_value("server.port"), 42) ;
TS_ASSERT_EQUALS(Configuration::int_value("input.udp-port"), 42) ;
TS_ASSERT_EQUALS(Configuration::string_value("config-file"),
config_file_name) ;
}