From cf099d11218cb6f6c5cce947d6738e347f07fb12 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 20 Feb 2011 12:57:14 +0000 Subject: Vendor import of llvm trunk r126079: http://llvm.org/svn/llvm-project/llvm/trunk@126079 --- unittests/Support/TimeValue.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 unittests/Support/TimeValue.cpp (limited to 'unittests/Support/TimeValue.cpp') diff --git a/unittests/Support/TimeValue.cpp b/unittests/Support/TimeValue.cpp new file mode 100644 index 000000000000..27883ae33564 --- /dev/null +++ b/unittests/Support/TimeValue.cpp @@ -0,0 +1,23 @@ +//===- 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 + +using namespace llvm; +namespace { + +TEST(Support, TimeValue) { + sys::TimeValue now = sys::TimeValue::now(); + time_t now_t = time(NULL); + EXPECT_TRUE(abs(static_cast(now_t - now.toEpochTime())) < 2); +} + +} -- cgit v1.2.3