diff --git a/googletest/test/googletest-port-test.cc b/googletest/test/googletest-port-test.cc index d01ccaae..1ba3f502 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( &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 af9733ad..0cf21852 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 #include #include "gtest/gtest.h" @@ -118,8 +119,8 @@ TEST(StressTest, CanUseScopedTraceAndAssertionsInManyThreads) { std::unique_ptr > threads[kThreadCount]; Notification threads_can_start; for (int i = 0; i != kThreadCount; i++) - threads[i].reset( - new ThreadWithParam(&ManyAsserts, i, &threads_can_start)); + threads[i] = std::make_unique>(&ManyAsserts, i, + &threads_can_start); threads_can_start.Notify();