[LLVMbugs] [Bug 16918] New: Incorrect use of abs() in unittests/Support/TimeValue.cpp

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 16 08:24:11 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16918

            Bug ID: 16918
           Summary: Incorrect use of abs() in
                    unittests/Support/TimeValue.cpp
           Product: Test Suite
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Nightly Tester
          Assignee: unassignedbugs at nondot.org
          Reporter: s_llvm at nedprod.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

--- a/unittests/Support/TimeValue.cpp
+++ b/unittests/Support/TimeValue.cpp
@@ -17,7 +17,7 @@ namespace {
 TEST(Support, TimeValue) {
   sys::TimeValue now = sys::TimeValue::now();
   time_t now_t = time(NULL);
-  EXPECT_TRUE(abs(static_cast<long>(now_t - now.toEpochTime())) < 2);
+  EXPECT_TRUE(labs(static_cast<long>(now_t - now.toEpochTime())) < 2);
 }

 }

Yeah I know this is incredibly pedantic, but it actually failed here in a
native QNX build. The labs() is the correct one to use.

Niall

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130816/580f5640/attachment.html>


More information about the llvm-bugs mailing list