summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--googletest/test/googletest-port-test.cc4
-rw-r--r--googletest/test/gtest_stress_test.cc5
2 files changed, 5 insertions, 4 deletions
diff --git a/googletest/test/googletest-port-test.cc b/googletest/test/googletest-port-test.cc
index d01ccaa..1ba3f50 100644
--- a/googletest/test/googletest-port-test.cc
+++ b/googletest/test/googletest-port-test.cc
@@ -1104,9 +1104,9 @@ TEST(MutexTest, OnlyOneThreadCanLockAtATime) {
// Creates and runs kThreadCount threads that increment locked_counter
// kCycleCount times each.
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),
- &threads_can_start));
+ &threads_can_start);
}
threads_can_start.Notify();
for (int i = 0; i < kThreadCount; ++i) counting_threads[i]->Join();
diff --git a/googletest/test/gtest_stress_test.cc b/googletest/test/gtest_stress_test.cc
index af9733a..0cf2185 100644
--- a/googletest/test/gtest_stress_test.cc
+++ b/googletest/test/gtest_stress_test.cc
@@ -30,6 +30,7 @@
// Tests that SCOPED_TRACE() and various Google Test assertions can be
// used in a large number of threads concurrently.
+#include <memory>
#include <vector>
#include "gtest/gtest.h"
@@ -118,8 +119,8 @@ TEST(StressTest, CanUseScopedTraceAndAssertionsInManyThreads) {
std::unique_ptr<ThreadWithParam<int> > threads[kThreadCount];
Notification threads_can_start;
for (int i = 0; i != kThreadCount; i++)
- threads[i].reset(
- new ThreadWithParam<int>(&ManyAsserts, i, &threads_can_start));
+ threads[i] = std::make_unique<ThreadWithParam<int>>(&ManyAsserts, i,
+ &threads_can_start);
threads_can_start.Notify();