mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
88e48a78d5
llvm-svn: 120330
24 lines
634 B
C++
24 lines
634 B
C++
//===- llvm/unittest/Support/TimeValue.cpp - Time Value 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/Support/TimeValue.h"
|
|
#include <time.h>
|
|
|
|
using namespace llvm;
|
|
namespace {
|
|
|
|
TEST(Support, TimeValue) {
|
|
sys::TimeValue now = sys::TimeValue::now();
|
|
time_t now_t = time(NULL);
|
|
EXPECT_TRUE(abs(static_cast<long>(now_t - now.toEpochTime())) < 2);
|
|
}
|
|
|
|
}
|