mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-03 07:31:41 +01:00
Replaced usage of gtest's internal scoped_ptr with unique_ptr.
scoped_ptr was removed in with gtest google/googletest@e857f9cdd9.
This commit is contained in:
committed by
Victor Zverovich
parent
ae1de3a8d3
commit
39623a7400
@@ -7,8 +7,9 @@
|
||||
|
||||
#include "gtest-extra.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
#include <gtest/gtest-spi.h>
|
||||
|
||||
@@ -18,8 +19,6 @@
|
||||
|
||||
#include "util.h"
|
||||
|
||||
using testing::internal::scoped_ptr;
|
||||
|
||||
namespace {
|
||||
|
||||
// This is used to suppress coverity warnings about untrusted values.
|
||||
@@ -340,7 +339,7 @@ TEST(OutputRedirectTest, FlushErrorInCtor) {
|
||||
// Put a character in a file buffer.
|
||||
EXPECT_EQ('x', fputc('x', f.get()));
|
||||
FMT_POSIX(close(write_fd));
|
||||
scoped_ptr<OutputRedirect> redir{FMT_NULL};
|
||||
std::unique_ptr<OutputRedirect> redir{FMT_NULL};
|
||||
EXPECT_SYSTEM_ERROR_NOASSERT(redir.reset(new OutputRedirect(f.get())),
|
||||
EBADF, "cannot flush stream");
|
||||
redir.reset(FMT_NULL);
|
||||
@@ -352,7 +351,7 @@ TEST(OutputRedirectTest, DupErrorInCtor) {
|
||||
int fd = (f.fileno)();
|
||||
file copy = file::dup(fd);
|
||||
FMT_POSIX(close(fd));
|
||||
scoped_ptr<OutputRedirect> redir{FMT_NULL};
|
||||
std::unique_ptr<OutputRedirect> redir{FMT_NULL};
|
||||
EXPECT_SYSTEM_ERROR_NOASSERT(redir.reset(new OutputRedirect(f.get())),
|
||||
EBADF, fmt::format("cannot duplicate file descriptor {}", fd));
|
||||
copy.dup2(fd); // "undo" close or dtor will fail
|
||||
@@ -394,7 +393,7 @@ TEST(OutputRedirectTest, ErrorInDtor) {
|
||||
int write_fd = write_end.descriptor();
|
||||
file write_copy = write_end.dup(write_fd);
|
||||
buffered_file f = write_end.fdopen("w");
|
||||
scoped_ptr<OutputRedirect> redir(new OutputRedirect(f.get()));
|
||||
std::unique_ptr<OutputRedirect> redir(new OutputRedirect(f.get()));
|
||||
// Put a character in a file buffer.
|
||||
EXPECT_EQ('x', fputc('x', f.get()));
|
||||
EXPECT_WRITE(stderr, {
|
||||
|
||||
Reference in New Issue
Block a user