5fa7b39183851156feae75e21be84a646aa863ca
[oota-llvm.git] / unittests / Support / System.cpp
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(static_cast<long>(now_t - now.toEpochTime())) < 2);
15 }
16 }