| 129 | class ThreadPoolTest : public testing::TestWithParam<int> {}; |
| 130 | |
| 131 | TEST_P(ThreadPoolTest, Performance) |
| 132 | { |
| 133 | int num_threads = GetParam(); |
| 134 | std::cout << "Test with " << num_threads << " threads." << "\n"; |
| 135 | ThreadPool threadpool(num_threads); |
| 136 | for (int i = 0; i < kLoopCount; ++i) |
| 137 | threadpool.AddTask(DoNothong); |
| 138 | // threadpool.WaitForIdle(); |
| 139 | } |
| 140 | |
| 141 | INSTANTIATE_TEST_CASE_P(ThreadPoolTest, ThreadPoolTest, testing::Values(1, 2, 4, 8, 16, 32)); |
| 142 |