[hamradio-commits] [gnss-sdr] 91/303: Improve double comparison

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Mon Feb 13 22:35:51 UTC 2017


This is an automated email from the git hooks/post-receive script.

carles_fernandez-guest pushed a commit to branch master
in repository gnss-sdr.

commit 6f2aabe0b63239b2c848ef8cec58f848ce0d9ab9
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date:   Mon Oct 3 18:34:53 2016 +0200

    Improve double comparison
    
    <and allow the USRP some time to set up between tests
---
 src/tests/system-tests/ttff_gps_l1.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/tests/system-tests/ttff_gps_l1.cc b/src/tests/system-tests/ttff_gps_l1.cc
index 949f670..f8c0640 100644
--- a/src/tests/system-tests/ttff_gps_l1.cc
+++ b/src/tests/system-tests/ttff_gps_l1.cc
@@ -30,10 +30,12 @@
  * -------------------------------------------------------------------------
  */
 
+#include <cerrno>
 #include <chrono>
 #include <cstdlib>
+#include <cmath>
 #include <ctime>
-#include <cerrno>
+#include <limits>
 #include <numeric>
 #include <string>
 #include <sys/types.h>
@@ -275,7 +277,7 @@ void receive_msg()
                             msgsnd(msqid_stop, &msg_stop, msgsend_size, IPC_NOWAIT);
                         }
 
-                    if(ttff_msg == -1)
+                    if( std::abs(ttff_msg - (-1.0) ) < 10 * std::numeric_limits<double>::epsilon() )
                         {
                             leave = true;
                         }
@@ -515,6 +517,7 @@ TEST_F(TTFF_GPS_L1_CA_Test, ColdStart)
 
     // Print TTFF report
     print_TTFF_report(TTFF_v, config);
+    std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(5)); //let the USRP some time to rest before the next test
 }
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git



More information about the pkg-hamradio-commits mailing list