Torok Edwin | b0a5bae | 2010-01-22 15:51:31 +0000 | [diff] [blame] | 1 | //===- llvm/unittest/Support/System.cpp - System tests --===// |
2 | #include "gtest/gtest.h" | ||||
3 | #include "llvm/System/TimeValue.h" | ||||
4 | #include <time.h> | ||||
5 | |||||
6 | using namespace llvm; | ||||
7 | namespace { | ||||
8 | class SystemTest : public ::testing::Test { | ||||
9 | }; | ||||
10 | |||||
11 | TEST_F(SystemTest, TimeValue) { | ||||
12 | sys::TimeValue now = sys::TimeValue::now(); | ||||
13 | time_t now_t = time(NULL); | ||||
14 | EXPECT_TRUE(abs(now_t - now.toEpochTime()) < 2); | ||||
15 | } | ||||
16 | } |