From d43da8ae0dd7feb2404264fb1572cfefb4c48479 Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 23 Dec 2015 22:33:40 -0800 Subject: [PATCH] DBTest.DelayedWriteRate: fix assert of sign and unsign comparison Summary: DBTest.DelayedWriteRate has sign and unsign comparisons that break Windows build. Fix it. Test Plan: Build and run the test modified. Reviewers: IslamAbdelRahman, rven, anthony, yhchiang, kradhakrishnan Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D52311 --- db/db_test.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/db_test.cc b/db/db_test.cc index 741b0168d..3f982e8ec 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -9097,8 +9097,10 @@ TEST_F(DBTest, DelayedWriteRate) { cur_rate /= kSlowdownRatio * kSlowdownRatio; } // Estimate the total sleep time fall into the rough range. - ASSERT_GT(env_->addon_time_.load(), estimated_sleep_time / 2); - ASSERT_LT(env_->addon_time_.load(), estimated_sleep_time * 2); + ASSERT_GT(env_->addon_time_.load(), + static_cast(estimated_sleep_time / 2)); + ASSERT_LT(env_->addon_time_.load(), + static_cast(estimated_sleep_time * 2)); env_->no_sleep_ = false; rocksdb::SyncPoint::GetInstance()->DisableProcessing();