From f7a4ead00d7988e76d2a22758f9e674644582620 Mon Sep 17 00:00:00 2001 From: cyy Date: Wed, 16 Jan 2019 13:40:46 +0800 Subject: [PATCH] fix warings --- lib/cpp/test/concurrency/TimerManagerTests.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/cpp/test/concurrency/TimerManagerTests.h b/lib/cpp/test/concurrency/TimerManagerTests.h index 24d829acf..a922826e9 100644 --- a/lib/cpp/test/concurrency/TimerManagerTests.h +++ b/lib/cpp/test/concurrency/TimerManagerTests.h @@ -36,7 +36,7 @@ class TimerManagerTests { public: class Task : public Runnable { public: - Task(Monitor& monitor, int64_t timeout) + Task(Monitor& monitor, uint64_t timeout) : _timeout(timeout), _startTime(std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()).count()), _endTime(0), @@ -72,7 +72,7 @@ public: * properly clean up itself and the remaining orphaned timeout task when the * manager goes out of scope and its destructor is called. */ - bool test00(int64_t timeout = 1000LL) { + bool test00(uint64_t timeout = 1000LL) { shared_ptr orphanTask = shared_ptr(new TimerManagerTests::Task(_monitor, 10 * timeout)); @@ -94,7 +94,7 @@ public: Synchronized s(_monitor); timerManager.add(orphanTask, 10 * timeout); - THRIFT_SLEEP_USEC(timeout * 1000); + std::this_thread::sleep_for(std::chrono::milliseconds(timeout)); task.reset(new TimerManagerTests::Task(_monitor, timeout)); timerManager.add(task, timeout); @@ -122,7 +122,7 @@ public: * verifies that the timer manager properly clean up itself and the remaining orphaned timeout * task when the manager goes out of scope and its destructor is called. */ - bool test01(int64_t timeout = 1000LL) { + bool test01(uint64_t timeout = 1000LL) { TimerManager timerManager; timerManager.threadFactory(shared_ptr(new ThreadFactory())); timerManager.start(); @@ -155,7 +155,7 @@ public: * clean up itself and the remaining orphaned timeout task when the manager goes out of scope * and its destructor is called. */ - bool test02(int64_t timeout = 1000LL) { + bool test02(uint64_t timeout = 1000LL) { TimerManager timerManager; timerManager.threadFactory(shared_ptr(new ThreadFactory())); timerManager.start(); @@ -188,7 +188,7 @@ public: * verifies that the timer manager properly clean up itself and the remaining orphaned timeout * task when the manager goes out of scope and its destructor is called. */ - bool test03(int64_t timeout = 1000LL) { + bool test03(uint64_t timeout = 1000LL) { TimerManager timerManager; timerManager.threadFactory(shared_ptr(new ThreadFactory())); timerManager.start(); @@ -225,7 +225,7 @@ public: /** * This test creates one tasks, and tries to remove it after it has expired. */ - bool test04(int64_t timeout = 1000LL) { + bool test04(uint64_t timeout = 1000LL) { TimerManager timerManager; timerManager.threadFactory(shared_ptr(new ThreadFactory())); timerManager.start();