diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-11-24 19:20:05 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-11-24 19:20:05 +0000 |
commit | f2ca4cb86df1d38c439f35774210b16f36841531 (patch) | |
tree | 1e34e5b1f175a61d12fc3664b0aa889717c8dc00 /unittests/System/TimeValue.cpp | |
parent | bf8209daf875fa533a379290a91d01be5152597d (diff) |
unittests: Add SystemTests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120101 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/System/TimeValue.cpp')
-rw-r--r-- | unittests/System/TimeValue.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/unittests/System/TimeValue.cpp b/unittests/System/TimeValue.cpp new file mode 100644 index 0000000000..d1da5c14ee --- /dev/null +++ b/unittests/System/TimeValue.cpp @@ -0,0 +1,23 @@ +//===- llvm/unittest/System/TimeValue.cpp - Time Vlaue 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/System/TimeValue.h" +#include <time.h> + +using namespace llvm; +namespace { + +TEST(System, TimeValue) { + sys::TimeValue now = sys::TimeValue::now(); + time_t now_t = time(NULL); + EXPECT_TRUE(abs(static_cast<long>(now_t - now.toEpochTime())) < 2); +} + +} |