From: Guilherme Maciel Ferreira Date: Wed, 26 Oct 2011 21:36:34 +0000 (-0200) Subject: Increased the assertion check required to construct a PingScheduler object X-Git-Tag: v1.2~47 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=f71cb7e1a52b17a94dd5a45118dff66988627e33;p=pingcheck Increased the assertion check required to construct a PingScheduler object --- diff --git a/src/host/pingscheduler.cpp b/src/host/pingscheduler.cpp index bcb103b..93bfb93 100644 --- a/src/host/pingscheduler.cpp +++ b/src/host/pingscheduler.cpp @@ -49,7 +49,7 @@ PingScheduler::PingScheduler( const string &network_interface, const string &destination_address, const int destination_port, - const PingProtocol protocol, + const PingProtocol ping_protocol, const long ping_interval_in_sec, const int ping_fail_percentage_limit, const string &nameserver, @@ -69,8 +69,13 @@ PingScheduler::PingScheduler( { BOOST_ASSERT( !network_interface.empty() ); BOOST_ASSERT( !destination_address.empty() ); + BOOST_ASSERT( 0 < destination_port ); + BOOST_ASSERT( (PingProtocol_First <= ping_protocol) && (ping_protocol <= PingProtocol_Last) ); + BOOST_ASSERT( 0 < ping_interval_in_sec ); + BOOST_ASSERT( (0 <= ping_fail_percentage_limit) && (ping_fail_percentage_limit <= 100) ); + BOOST_ASSERT( !nameserver.empty() ); - Ping = PingerFactory::createPinger( protocol, IoService, network_interface ); + Ping = PingerFactory::createPinger( ping_protocol, IoService, network_interface ); } PingScheduler::~PingScheduler() diff --git a/src/host/pingscheduler.h b/src/host/pingscheduler.h index feed1d3..5a325f5 100644 --- a/src/host/pingscheduler.h +++ b/src/host/pingscheduler.h @@ -52,7 +52,7 @@ public: const std::string &network_interface, const std::string &destination_address, const int destination_port, - const PingProtocol protocol, + const PingProtocol ping_protocol, const long ping_interval_in_sec, const int ping_fail_percentage_limit, const std::string &nameserver,