From 3610f34c70f0db4b4fde1362d37e1fb32c5b0f7d Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 4 Mar 2017 07:10:54 -0800 Subject: [PATCH] Fix windows build --- test/gtest-extra.h | 2 +- test/posix-mock-test.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/gtest-extra.h b/test/gtest-extra.h index 0f38dd31..be6708c0 100644 --- a/test/gtest-extra.h +++ b/test/gtest-extra.h @@ -84,7 +84,7 @@ std::string format_system_error(int error_code, fmt::string_view message); #define EXPECT_SYSTEM_ERROR(statement, error_code, message) \ - EXPECT_THROW_MSG(statement, fmt::SystemError, \ + EXPECT_THROW_MSG(statement, fmt::system_error, \ format_system_error(error_code, message)) #if FMT_USE_FILE_DESCRIPTORS diff --git a/test/posix-mock-test.cc b/test/posix-mock-test.cc index 69f44567..f4722b79 100644 --- a/test/posix-mock-test.cc +++ b/test/posix-mock-test.cc @@ -283,7 +283,7 @@ TEST(FileTest, Size) { fmt::internal::format_windows_error( message, ERROR_ACCESS_DENIED, "cannot get file size"); fstat_sim = ERROR; - EXPECT_THROW_MSG(f.size(), fmt::WindowsError, fmt::to_string(message)); + EXPECT_THROW_MSG(f.size(), fmt::windows_error, fmt::to_string(message)); fstat_sim = NONE; #else f.close(); @@ -340,7 +340,7 @@ TEST(FileTest, ConvertReadCount) { ++size; read_count = 1; read_nbyte = 0; - EXPECT_THROW(read_end.read(&c, size), fmt::SystemError); + EXPECT_THROW(read_end.read(&c, size), fmt::system_error); read_count = 0; EXPECT_EQ(UINT_MAX, read_nbyte); } @@ -354,7 +354,7 @@ TEST(FileTest, ConvertWriteCount) { ++size; write_count = 1; write_nbyte = 0; - EXPECT_THROW(write_end.write(&c, size), fmt::SystemError); + EXPECT_THROW(write_end.write(&c, size), fmt::system_error); write_count = 0; EXPECT_EQ(UINT_MAX, write_nbyte); }