From: Christian Herdtweck Date: Thu, 28 May 2015 14:04:59 +0000 (+0200) Subject: fixed and re-enabled unit tests X-Git-Url: http://developer.intra2net.com/git/?p=pingcheck;a=commitdiff_plain;h=f6c397651a44a7b9a34d7845263c3af4d7f72a51 fixed and re-enabled unit tests --- diff --git a/pingcheck.spec b/pingcheck.spec index f5132aa..6145fcd 100644 --- a/pingcheck.spec +++ b/pingcheck.spec @@ -1,7 +1,7 @@ Summary: Pingcheck Name: pingcheck Version: ##VERSION## -Release: 1 +Release: ##VERSION_REVISION## License: GPLv2 + linking exception. Some parts under boost license. Group: Intranator Vendor: Intra2net AG @@ -34,7 +34,7 @@ make %{_smp_mflags} %check cd build -make %{_smp_mflags} check || echo "Unit test failed. Ignoring for now" +make %{_smp_mflags} check %install rm -rf $RPM_BUILD_ROOT diff --git a/test/test_hoststatus.cpp b/test/test_hoststatus.cpp index 607daa1..8355700 100644 --- a/test/test_hoststatus.cpp +++ b/test/test_hoststatus.cpp @@ -63,7 +63,7 @@ BOOST_AUTO_TEST_CASE( fail_percentage_10 ) BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration); BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); @@ -117,22 +117,22 @@ BOOST_AUTO_TEST_CASE( fail_percentage_50 ) BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_SuccessReply, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_SuccessReply, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); @@ -162,28 +162,28 @@ BOOST_AUTO_TEST_CASE( fail_percentage_80 ) host_status.set_resolved_ip_count( resolved_ip_count ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); - BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), false ); + BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true ); host_status.update_ping_statistics( PingStatus_FailureOther, duration ); BOOST_CHECK_EQUAL( host_status.exceeded_ping_failed_limit(), true );