Fix MSVC warning

This commit is contained in:
Antoine Pitrou committed 2018-05-23 22:09:46 +02:00
1 parent 6b6f64a1e5
commit 6b685406e3
3 files changed
+7 -6

No files matched your search

+2 -1
View File
@@ -239,7 +239,8 @@ TEST(PandasConversionTest, TestObjectBlockWriteFails) {
Py_BEGIN_ALLOW_THREADS;
PandasOptions options;
MemoryPool* pool = default_memory_pool();
ASSERT_RAISES(UnknownError, ConvertTableToPandas(options, table, 2, pool, &out));
ASSERT_RAISES(UnknownError,
ConvertTableToPandas(options, table, true /* use_threads */, pool, &out));
Py_END_ALLOW_THREADS;
}
+4 -4
View File
@@ -127,7 +127,7 @@ class TestThreadPool : public ::testing::Test {
std::shared_ptr<ThreadPool> MakeThreadPool() { return MakeThreadPool(4); }
std::shared_ptr<ThreadPool> MakeThreadPool(size_t threads) {
std::shared_ptr<ThreadPool> MakeThreadPool(int threads) {
std::shared_ptr<ThreadPool> pool;
Status st = ThreadPool::Make(threads, &pool);
return pool;
@@ -163,7 +163,7 @@ class TestThreadPool : public ::testing::Test {
TEST_F(TestThreadPool, ConstructDestruct) {
// Stress shutdown-at-destruction logic
for (size_t threads : {1, 2, 3, 8, 32, 70}) {
for (int threads : {1, 2, 3, 8, 32, 70}) {
auto pool = this->MakeThreadPool(threads);
}
}
@@ -285,7 +285,7 @@ TEST_F(TestThreadPool, Submit) {
TEST(TestGlobalThreadPool, Capacity) {
// Sanity check
auto pool = GetCpuThreadPool();
size_t capacity = pool->GetCapacity();
int capacity = pool->GetCapacity();
ASSERT_GT(capacity, 0);
ASSERT_EQ(pool->GetActualCapacity(), capacity);
ASSERT_EQ(GetCpuThreadPoolCapacity(), capacity);
@@ -293,7 +293,7 @@ TEST(TestGlobalThreadPool, Capacity) {
// Exercise default capacity heuristic
ASSERT_OK(DelEnvVar("OMP_NUM_THREADS"));
ASSERT_OK(DelEnvVar("OMP_THREAD_LIMIT"));
size_t hw_capacity = std::thread::hardware_concurrency();
int hw_capacity = std::thread::hardware_concurrency();
ASSERT_EQ(ThreadPool::DefaultCapacity(), hw_capacity);
ASSERT_OK(SetEnvVar("OMP_NUM_THREADS", "13"));
ASSERT_EQ(ThreadPool::DefaultCapacity(), 13);
+1 -1
View File
@@ -58,7 +58,7 @@ int ThreadPool::GetCapacity() {
int ThreadPool::GetActualCapacity() {
std::unique_lock<std::mutex> lock(mutex_);
return workers_.size();
return static_cast<int>(workers_.size());
}
Status ThreadPool::Shutdown(bool wait) {