From d02a5031f0b550605d49fc9b65f70afe57d3a782 Mon Sep 17 00:00:00 2001 From: vitaut Date: Wed, 29 Jul 2015 07:03:15 -0700 Subject: [PATCH] Use scoped_ptr instead of deprecated auto_ptr --- test/posix-mock-test.cc | 3 +-- test/posix-test.cc | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/posix-mock-test.cc b/test/posix-mock-test.cc index a8eb1829..c41f5956 100644 --- a/test/posix-mock-test.cc +++ b/test/posix-mock-test.cc @@ -34,7 +34,6 @@ #include #include #include -#include #ifdef _WIN32 # include @@ -248,7 +247,7 @@ TEST(FileTest, OpenRetry) { TEST(FileTest, CloseNoRetryInDtor) { File read_end, write_end; File::pipe(read_end, write_end); - std::auto_ptr f(new File(std::move(read_end))); + testing::internal::scoped_ptr f(new File(std::move(read_end))); int saved_close_count = 0; EXPECT_WRITE(stderr, { close_count = 1; diff --git a/test/posix-test.cc b/test/posix-test.cc index 10f92d72..4a2e678c 100644 --- a/test/posix-test.cc +++ b/test/posix-test.cc @@ -26,7 +26,6 @@ */ #include -#include #include "gtest-extra.h" #include "posix.h" @@ -137,7 +136,8 @@ TEST(BufferedFileTest, CloseFileInDtor) { } TEST(BufferedFileTest, CloseErrorInDtor) { - std::auto_ptr f(new BufferedFile(open_buffered_file())); + testing::internal::scoped_ptr f( + new BufferedFile(open_buffered_file())); EXPECT_WRITE(stderr, { // The close function must be called inside EXPECT_WRITE, otherwise // the system may recycle closed file descriptor when redirecting the