diff --git a/test/util-test.cc b/test/util-test.cc index bceeaa49..52a3b04b 100644 --- a/test/util-test.cc +++ b/test/util-test.cc @@ -171,23 +171,6 @@ TEST(UtilTest, SystemError) { typedef void (*FormatErrorMessage)( fmt::Writer &out, int error_code, StringRef message); -template -void CheckErrorSink(int error_code, FormatErrorMessage format) { - fmt::SystemError error(0, ""); - Sink sink(error_code); - fmt::Writer w; - w << "test"; - try { - sink(w); - } catch (const fmt::SystemError &e) { - error = e; - } - fmt::Writer message; - format(message, error_code, "test"); - EXPECT_EQ(message.str(), error.what()); - EXPECT_EQ(error_code, error.error_code()); -} - template void CheckThrowError(int error_code, FormatErrorMessage format) { fmt::SystemError error(0, ""); @@ -209,11 +192,6 @@ TEST(UtilTest, FormatSystemErrorMessage) { GetSystemErrorMessage(EDOM)), message.str()); } -TEST(UtilTest, SystemErrorSink) { - CheckErrorSink( - EDOM, fmt::internal::FormatSystemErrorMessage); -} - TEST(UtilTest, ThrowSystemError) { CheckThrowError(EDOM, fmt::internal::FormatSystemErrorMessage); } @@ -242,11 +220,6 @@ TEST(UtilTest, FormatWinErrorMessage) { actual_message.str()); } -TEST(UtilTest, WinErrorSink) { - CheckErrorSink( - ERROR_FILE_EXISTS, fmt::internal::FormatWinErrorMessage); -} - TEST(UtilTest, ThrowWinError) { CheckThrowError( ERROR_FILE_EXISTS, fmt::internal::FormatWinErrorMessage);