summaryrefslogtreecommitdiffstats
path: root/src/gtest
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2017-01-12 10:31:14 +0200
committerHanoh Haim <hhaim@cisco.com>2017-01-12 14:33:15 +0200
commit58d22eef5cffdf6f006e5f34c82bfbd3ebe79604 (patch)
tree29555f882b6d4a8060695097dbd107bec6465afb /src/gtest
parenta6e3bf69eb5b338047f4338a3cecc052db042188 (diff)
abs fix
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/gtest')
-rw-r--r--src/gtest/bp_timer_gtest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gtest/bp_timer_gtest.cpp b/src/gtest/bp_timer_gtest.cpp
index 1e8e7069..70e5e192 100644
--- a/src/gtest/bp_timer_gtest.cpp
+++ b/src/gtest/bp_timer_gtest.cpp
@@ -23,7 +23,7 @@ limitations under the License.
#include <common/basic_utils.h>
#include "h_timer.h"
#include <common/utl_gcc_diag.h>
-
+#include <cmath>
class gt_r_timer : public testing::Test {
@@ -711,7 +711,7 @@ void CNATimerWheelTest1::on_tick(CMyTestObject *lpobj){
if (expect_min>m_div_err) {
expect_min-=m_div_err*2;
}
- double pre=abs(100.0-100.0*(double)m_ticks/(double)m_expect_tick);
+ double pre=std::abs(100.0-100.0*(double)m_ticks/(double)m_expect_tick);
if (pre>m_max_err){
m_max_err=pre;
}
@@ -1051,7 +1051,7 @@ void CNATimerWheelTest2::on_tick(CMyTestObject *lp){
}
m_timer.timer_start(&lp->m_timer,lp->m_d_tick);
if (!m_cfg.m_dont_check){
- double pre=abs(100.0-100.0*(double)m_ticks/(double)lp->m_t_tick);
+ double pre=std::abs(100.0-100.0*(double)m_ticks/(double)lp->m_t_tick);
if (pre>(200.0/(double)m_div_err)) {
printf(" =====>tick:%d %f \n",m_ticks,pre);
assert(0);