fixed and re-enabled unit tests
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 28 May 2015 14:04:59 +0000 (16:04 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 28 May 2015 14:04:59 +0000 (16:04 +0200)
pingcheck.spec
test/test_hoststatus.cpp

index f5132aa..6145fcd 100644 (file)
@@ -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
index 607daa1..8355700 100644 (file)
@@ -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 );