diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-07-16 02:03:32 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-07-16 02:03:32 +0000 |
commit | e7f0393f6d080f599f225dcdc440142e758ffe1b (patch) | |
tree | 2a849e049dab0da3a773c6fdc5828166dd50df5a /unittests/Support/TimeValueTest.cpp | |
parent | 4172a8abbabea2359d91bb07101166565127d798 (diff) | |
download | llvm-e7f0393f6d080f599f225dcdc440142e758ffe1b.tar.gz llvm-e7f0393f6d080f599f225dcdc440142e758ffe1b.tar.bz2 llvm-e7f0393f6d080f599f225dcdc440142e758ffe1b.tar.xz |
Rename Support.TimeValue to TimeValue.time_t in unittests/Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186372 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support/TimeValueTest.cpp')
-rw-r--r-- | unittests/Support/TimeValueTest.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/unittests/Support/TimeValueTest.cpp b/unittests/Support/TimeValueTest.cpp new file mode 100644 index 0000000000..0fd5675015 --- /dev/null +++ b/unittests/Support/TimeValueTest.cpp @@ -0,0 +1,23 @@ +//===- llvm/unittest/Support/TimeValueTest.cpp - Time Value tests ---------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "gtest/gtest.h" +#include "llvm/Support/TimeValue.h" +#include <time.h> + +using namespace llvm; +namespace { + +TEST(TimeValue, time_t) { + sys::TimeValue now = sys::TimeValue::now(); + time_t now_t = time(NULL); + EXPECT_TRUE(abs(static_cast<long>(now_t - now.toEpochTime())) < 2); +} + +} |