fixed trouble in unittests: when I changed/added options I forgot to adjust correspon...
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Fri, 20 Mar 2015 10:12:15 +0000 (11:12 +0100)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Fri, 20 Mar 2015 10:12:15 +0000 (11:12 +0100)
test/test_configurationoptions.cpp

index 441927e..f545c59 100644 (file)
@@ -120,8 +120,9 @@ BOOST_AUTO_TEST_CASE( get_configuration_options )
     std::vector< option_description_item > options = config_options.get_configuration_options().options();
 
     // if this assert fails, you must add or remove one of the options in the
-    // test bellow
-    BOOST_CHECK_EQUAL( options.size(), 12 );
+    // test below. Will probably find them all in
+    // src/config/configurationoptions.cpp constructor
+    BOOST_CHECK_EQUAL( options.size(), 16 );
 
     BOOST_CHECK_EQUAL( option_present( options, "hosts-down-limit" ), true );
     BOOST_CHECK_EQUAL( option_present( options, "link-down-interval" ), true );
@@ -130,6 +131,10 @@ BOOST_AUTO_TEST_CASE( get_configuration_options )
     BOOST_CHECK_EQUAL( option_present( options, "ping-fail-limit" ), true );
     BOOST_CHECK_EQUAL( option_present( options, "default-source-network-interface" ), true );
     BOOST_CHECK_EQUAL( option_present( options, "status-notifier-cmd" ), true );
+    BOOST_CHECK_EQUAL( option_present( options, "ping-reply-timeout" ), true );
+    BOOST_CHECK_EQUAL( option_present( options, "max-address-resolution-attempts" ), true );
+    BOOST_CHECK_EQUAL( option_present( options, "resolved-ip-ttl-threshold" ), true );
+    BOOST_CHECK_EQUAL( option_present( options, "ratio-random-hosts" ), true );
     BOOST_CHECK_EQUAL( option_present( options, "host.name" ), true );
     BOOST_CHECK_EQUAL( option_present( options, "host.port" ), true );
     BOOST_CHECK_EQUAL( option_present( options, "host.source-network-interface" ), true );
@@ -187,43 +192,43 @@ BOOST_AUTO_TEST_CASE( parse_hosts_options )
     std::vector<int> hosts_ports;
     std::vector<std::string> hosts_source_interfaces;
     std::vector<std::string> hosts_ping_protocols;
-    std::vector<int> hosts_intervals;
+    std::vector<std::string> hosts_intervals;
     // host 1
     hosts_names.push_back( "www.fazenda.gov.br" );
     hosts_ports.push_back( 61 );
     hosts_source_interfaces.push_back( "eth1" );
     hosts_ping_protocols.push_back( "TCP" );
-    hosts_intervals.push_back( 71 );
+    hosts_intervals.push_back( "71" );
     // host 2
     hosts_names.push_back( "www.intra2net.de" );
     hosts_ports.push_back( 62 );
     hosts_source_interfaces.push_back( "eth2" );
     hosts_ping_protocols.push_back( "ICMP" );
-    hosts_intervals.push_back( 72 );
+    hosts_intervals.push_back( "72" );
     // host 3
     hosts_names.push_back( "www.ufsc.br" );
     hosts_ports.push_back( 63 );
     hosts_source_interfaces.push_back( "eth3" );
     hosts_ping_protocols.push_back( "ICMPv6" );
-    hosts_intervals.push_back( 73 );
+    hosts_intervals.push_back( "73" );
     // host 4
     hosts_names.push_back( "www.google.com" );
     hosts_ports.push_back( 64 );
     hosts_source_interfaces.push_back( "eth4" );
     hosts_ping_protocols.push_back( "TCP_IPv6" );
-    hosts_intervals.push_back( 74 );
+    hosts_intervals.push_back( "74" );
     // host 5
     hosts_names.push_back( "www.kernel.org" );
     hosts_ports.push_back( 64 );
     hosts_source_interfaces.push_back( "eth5" );
     hosts_ping_protocols.push_back( "TCP_IPv4,ICMPv4" );
-    hosts_intervals.push_back( 75 );
+    hosts_intervals.push_back( "75" );
     // host 6
     hosts_names.push_back( "www.linux.com" );
     hosts_ports.push_back( 64 );
     hosts_source_interfaces.push_back( "eth6" );
     hosts_ping_protocols.push_back( "ICMPv6,TCP_IPv6" );
-    hosts_intervals.push_back( 76 );
+    hosts_intervals.push_back( "76" );
 
     ConfigurationOptions config_options;
     Configuration configuration;