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); }