Apply clang-tidy fixes
PiperOrigin-RevId: 515265927 Change-Id: Iea11668fa4bbf08f6d418a3823e836fb5b874dcc
This commit is contained in:
parent
48a1b11058
commit
50e07d1c92
@ -1104,9 +1104,9 @@ TEST(MutexTest, OnlyOneThreadCanLockAtATime) {
|
|||||||
// Creates and runs kThreadCount threads that increment locked_counter
|
// Creates and runs kThreadCount threads that increment locked_counter
|
||||||
// kCycleCount times each.
|
// kCycleCount times each.
|
||||||
for (int i = 0; i < kThreadCount; ++i) {
|
for (int i = 0; i < kThreadCount; ++i) {
|
||||||
counting_threads[i].reset(new ThreadType(
|
counting_threads[i] = std::make_unique<ThreadType>(
|
||||||
&CountingThreadFunc, make_pair(&locked_counter, kCycleCount),
|
&CountingThreadFunc, make_pair(&locked_counter, kCycleCount),
|
||||||
&threads_can_start));
|
&threads_can_start);
|
||||||
}
|
}
|
||||||
threads_can_start.Notify();
|
threads_can_start.Notify();
|
||||||
for (int i = 0; i < kThreadCount; ++i) counting_threads[i]->Join();
|
for (int i = 0; i < kThreadCount; ++i) counting_threads[i]->Join();
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
// Tests that SCOPED_TRACE() and various Google Test assertions can be
|
// Tests that SCOPED_TRACE() and various Google Test assertions can be
|
||||||
// used in a large number of threads concurrently.
|
// used in a large number of threads concurrently.
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
@ -118,8 +119,8 @@ TEST(StressTest, CanUseScopedTraceAndAssertionsInManyThreads) {
|
|||||||
std::unique_ptr<ThreadWithParam<int> > threads[kThreadCount];
|
std::unique_ptr<ThreadWithParam<int> > threads[kThreadCount];
|
||||||
Notification threads_can_start;
|
Notification threads_can_start;
|
||||||
for (int i = 0; i != kThreadCount; i++)
|
for (int i = 0; i != kThreadCount; i++)
|
||||||
threads[i].reset(
|
threads[i] = std::make_unique<ThreadWithParam<int>>(&ManyAsserts, i,
|
||||||
new ThreadWithParam<int>(&ManyAsserts, i, &threads_can_start));
|
&threads_can_start);
|
||||||
|
|
||||||
threads_can_start.Notify();
|
threads_can_start.Notify();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user