Pavel Labath c4063eee0d Introduce chrono to the Communication class
This replaces the raw integer timeout parameters in the class with their
chrono-based equivalents.  To achieve this, I have moved the Timeout class to a
more generic place and added a quick unit test for it.

llvm-svn: 287920
2016-11-25 11:58:44 +00:00

23 lines
794 B
C++

//===-- TimeoutTest.cpp -----------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "lldb/Utility/Timeout.h"
#include "gtest/gtest.h"
using namespace lldb_private;
using namespace std::chrono;
TEST(TimeoutTest, Construction) {
ASSERT_FALSE(Timeout<std::micro>(llvm::None));
ASSERT_TRUE(bool(Timeout<std::micro>(seconds(0))));
ASSERT_EQ(seconds(0), *Timeout<std::micro>(seconds(0)));
ASSERT_EQ(seconds(3), *Timeout<std::micro>(seconds(3)));
ASSERT_TRUE(bool(Timeout<std::micro>(Timeout<std::milli>(seconds(0)))));
}