aboutsummaryrefslogtreecommitdiff
path: root/unittests/Support/TimeValue.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-11-29 22:29:04 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-11-29 22:29:04 +0000
commit013d15a677f70aa9c91fa09707e5d4248146b99d (patch)
tree5bce3eaa77f5e3f8f482b57b2425cf8b5c5ab5df /unittests/Support/TimeValue.cpp
parentdffde9964480f946d4308ce936b667b6c37b1059 (diff)
unittests: Merge SystemTests back into SupportTests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120330 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support/TimeValue.cpp')
-rw-r--r--unittests/Support/TimeValue.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/unittests/Support/TimeValue.cpp b/unittests/Support/TimeValue.cpp
new file mode 100644
index 0000000000..27883ae335
--- /dev/null
+++ b/unittests/Support/TimeValue.cpp
@@ -0,0 +1,23 @@
+//===- llvm/unittest/Support/TimeValue.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(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);
+}
+
+}