2010-11-29 23:29:04 +01:00
|
|
|
//===- llvm/unittest/Support/TimeValue.cpp - Time Value tests -------------===//
|
2010-11-24 20:20:05 +01:00
|
|
|
//
|
|
|
|
// 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"
|
2010-11-29 19:16:10 +01:00
|
|
|
#include "llvm/Support/TimeValue.h"
|
2010-11-24 20:20:05 +01:00
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
namespace {
|
|
|
|
|
2010-11-29 23:29:04 +01:00
|
|
|
TEST(Support, TimeValue) {
|
2010-11-24 20:20:05 +01:00
|
|
|
sys::TimeValue now = sys::TimeValue::now();
|
|
|
|
time_t now_t = time(NULL);
|
|
|
|
EXPECT_TRUE(abs(static_cast<long>(now_t - now.toEpochTime())) < 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|