mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-06 14:38:17 +01:00
commit
51fe05a443
41 changed files with 3817 additions and 2059 deletions
12
externals/fmt/test/gtest-extra-test.cc
vendored
12
externals/fmt/test/gtest-extra-test.cc
vendored
|
|
@ -311,8 +311,8 @@ using fmt::error_code;
|
|||
using fmt::file;
|
||||
|
||||
TEST(ErrorCodeTest, Ctor) {
|
||||
EXPECT_EQ(0, error_code().get());
|
||||
EXPECT_EQ(42, error_code(42).get());
|
||||
EXPECT_EQ(error_code().get(), 0);
|
||||
EXPECT_EQ(error_code(42).get(), 42);
|
||||
}
|
||||
|
||||
TEST(OutputRedirectTest, ScopedRedirect) {
|
||||
|
|
@ -340,10 +340,10 @@ 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{nullptr};
|
||||
scoped_ptr<OutputRedirect> redir{FMT_NULL};
|
||||
EXPECT_SYSTEM_ERROR_NOASSERT(redir.reset(new OutputRedirect(f.get())),
|
||||
EBADF, "cannot flush stream");
|
||||
redir.reset(nullptr);
|
||||
redir.reset(FMT_NULL);
|
||||
write_copy.dup2(write_fd); // "undo" close or dtor will fail
|
||||
}
|
||||
|
||||
|
|
@ -352,7 +352,7 @@ TEST(OutputRedirectTest, DupErrorInCtor) {
|
|||
int fd = (f.fileno)();
|
||||
file copy = file::dup(fd);
|
||||
FMT_POSIX(close(fd));
|
||||
scoped_ptr<OutputRedirect> redir{nullptr};
|
||||
scoped_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
|
||||
|
|
@ -403,7 +403,7 @@ TEST(OutputRedirectTest, ErrorInDtor) {
|
|||
// output in EXPECT_STDERR and the second close will break output
|
||||
// redirection.
|
||||
FMT_POSIX(close(write_fd));
|
||||
SUPPRESS_ASSERT(redir.reset(nullptr));
|
||||
SUPPRESS_ASSERT(redir.reset(FMT_NULL));
|
||||
}, format_system_error(EBADF, "cannot flush stream"));
|
||||
write_copy.dup2(write_fd); // "undo" close or dtor of buffered_file will fail
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue