llvm-6502/unittests/System/TimeValue.cpp
Michael J. Spencer f2ca4cb86d unittests: Add SystemTests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 19:20:05 +00:00

24 lines
632 B
C++

//===- 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);
}
}