// if this assert fails, you must add or remove one of the options in the
// test bellow
- BOOST_CHECK_EQUAL( options.size(), 6 ); // help, version, daemon, config-file, log-level and log-output
+ BOOST_CHECK_EQUAL( options.size(), 7 );
+ // help, version, daemon, config-file, log-level, log-output, log-file
BOOST_CHECK_EQUAL( option_present( options, "help" ), true );
BOOST_CHECK_EQUAL( option_present( options, "config-file" ), true );
BOOST_CHECK_EQUAL( option_present( options, "version" ), true );
BOOST_CHECK_EQUAL( option_present( options, "log-level" ), true );
BOOST_CHECK_EQUAL( option_present( options, "log-output" ), true );
+ BOOST_CHECK_EQUAL( option_present( options, "log-file" ), true );
}
BOOST_AUTO_TEST_CASE( get_configuration_options )
option_insert( "daemon", boost::any(), vm );
option_insert( "log-level", boost::any( std::string("EMERGENCY") ), vm );
option_insert( "log-output", boost::any( std::string("TERMINAL") ), vm );
+ option_insert( "log-file", boost::any( std::string("pingcheck_test.log") ), vm );
ConfigurationOptions config_options;
Configuration configuration;
BOOST_CHECK_EQUAL( configuration.get_daemon(), true );
BOOST_CHECK_EQUAL( static_cast<int>(configuration.get_log_level()), static_cast<int>(I2n::Logger::LogLevel::Emergency) );
BOOST_CHECK_EQUAL( static_cast<int>(configuration.get_log_output()), static_cast<int>(LogOutput_TERMINAL) );
+ BOOST_CHECK_EQUAL( configuration.get_log_file(), "pingcheck_test.log" );
}
BOOST_AUTO_TEST_CASE( parse_configuration_options )
option_clear_and_insert( "log-output", value, vm );
BOOST_CHECK_EQUAL( config_options.halt_on_generic_options( vm ), false );
+ option_clear_and_insert( "log-file", value, vm );
+ BOOST_CHECK_EQUAL( config_options.halt_on_generic_options( vm ), false );
+
option_clear_and_insert( "hosts-down-limit", value, vm );
BOOST_CHECK_EQUAL( config_options.halt_on_generic_options( vm ), false );