mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-02 11:28:20 +00:00
Use scoped_ptr instead of deprecated auto_ptr
This commit is contained in:
parent
200037683e
commit
d02a5031f0
@ -34,7 +34,6 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <climits>
|
||||
#include <memory>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <io.h>
|
||||
@ -248,7 +247,7 @@ TEST(FileTest, OpenRetry) {
|
||||
TEST(FileTest, CloseNoRetryInDtor) {
|
||||
File read_end, write_end;
|
||||
File::pipe(read_end, write_end);
|
||||
std::auto_ptr<File> f(new File(std::move(read_end)));
|
||||
testing::internal::scoped_ptr<File> f(new File(std::move(read_end)));
|
||||
int saved_close_count = 0;
|
||||
EXPECT_WRITE(stderr, {
|
||||
close_count = 1;
|
||||
|
@ -26,7 +26,6 @@
|
||||
*/
|
||||
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
|
||||
#include "gtest-extra.h"
|
||||
#include "posix.h"
|
||||
@ -137,7 +136,8 @@ TEST(BufferedFileTest, CloseFileInDtor) {
|
||||
}
|
||||
|
||||
TEST(BufferedFileTest, CloseErrorInDtor) {
|
||||
std::auto_ptr<BufferedFile> f(new BufferedFile(open_buffered_file()));
|
||||
testing::internal::scoped_ptr<BufferedFile> 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
|
||||
|
Loading…
Reference in New Issue
Block a user