Googletest export
Remove scoped_ptr replace with std::unique_ptr PiperOrigin-RevId: 219291284
This commit is contained in:
@@ -524,8 +524,7 @@ class DeathTestAndMultiThreadsTest : public testing::Test {
|
||||
|
||||
private:
|
||||
SpawnThreadNotifications notifications_;
|
||||
testing::internal::scoped_ptr<ThreadWithParam<SpawnThreadNotifications*> >
|
||||
thread_;
|
||||
std::unique_ptr<ThreadWithParam<SpawnThreadNotifications*> > thread_;
|
||||
};
|
||||
|
||||
#endif // GTEST_IS_THREADSAFE
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#endif // GTEST_OS_MAC
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <utility> // For std::pair and std::make_pair.
|
||||
#include <vector>
|
||||
|
||||
@@ -218,14 +219,6 @@ TEST(IteratorTraitsTest, WorksForPointerToConst) {
|
||||
IteratorTraits<const void* const*>::value_type>();
|
||||
}
|
||||
|
||||
// Tests that the element_type typedef is available in scoped_ptr and refers
|
||||
// to the parameter type.
|
||||
TEST(ScopedPtrTest, DefinesElementType) {
|
||||
StaticAssertTypeEq<int, ::testing::internal::scoped_ptr<int>::element_type>();
|
||||
}
|
||||
|
||||
// FIXME: Implement THE REST of scoped_ptr tests.
|
||||
|
||||
TEST(GtestCheckSyntaxTest, BehavesLikeASingleStatement) {
|
||||
if (AlwaysFalse())
|
||||
GTEST_CHECK_(false) << "This should never be executed; "
|
||||
@@ -1095,7 +1088,7 @@ TEST(MutexTest, OnlyOneThreadCanLockAtATime) {
|
||||
typedef ThreadWithParam<pair<AtomicCounterWithMutex*, int> > ThreadType;
|
||||
const int kCycleCount = 20;
|
||||
const int kThreadCount = 7;
|
||||
scoped_ptr<ThreadType> counting_threads[kThreadCount];
|
||||
std::unique_ptr<ThreadType> counting_threads[kThreadCount];
|
||||
Notification threads_can_start;
|
||||
// Creates and runs kThreadCount threads that increment locked_counter
|
||||
// kCycleCount times each.
|
||||
|
||||
@@ -41,7 +41,6 @@ using ::testing::Test;
|
||||
using ::testing::TestEventListeners;
|
||||
using ::testing::TestInfo;
|
||||
using ::testing::UnitTest;
|
||||
using ::testing::internal::scoped_ptr;
|
||||
|
||||
// The test methods are empty, as the sole purpose of this program is
|
||||
// to print the test names before/after shuffling.
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace {
|
||||
using internal::Notification;
|
||||
using internal::TestPropertyKeyIs;
|
||||
using internal::ThreadWithParam;
|
||||
using internal::scoped_ptr;
|
||||
|
||||
// In order to run tests in this file, for platforms where Google Test is
|
||||
// thread safe, implement ThreadWithParam. See the description of its API
|
||||
@@ -119,7 +118,7 @@ void CheckTestFailureCount(int expected_failures) {
|
||||
// concurrently.
|
||||
TEST(StressTest, CanUseScopedTraceAndAssertionsInManyThreads) {
|
||||
{
|
||||
scoped_ptr<ThreadWithParam<int> > threads[kThreadCount];
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user