Refactors parallel barrier test
authorPeizhao Ou <peizhaoo@uci.edu>
Tue, 13 Mar 2018 00:29:05 +0000 (17:29 -0700)
committerPeizhao Ou <peizhaoo@uci.edu>
Tue, 13 Mar 2018 00:29:05 +0000 (17:29 -0700)
test/stress/misc/barrier_driver.cpp

index 8dfc41d..272e3c4 100644 (file)
@@ -48,8 +48,8 @@ TEST_F(BarrierTest, Wait) {
     threads.push_back(std::thread(Thread));
   }
 
-  for (size_t i = 0; i < s_nBarrierThreadCount; i++) {
-    threads[i].join();
+  for (auto& thrd : threads) {
+    thrd.join();
   }
   EXPECT_EQ(count, s_nBarrierPassCount);
   delete barrier;