Use Kill-o-Zap

This commit is contained in:
Victor Zverovich 2014-07-01 09:17:37 -07:00
parent 39166f9aa9
commit b8174bec30

View File

@ -171,23 +171,6 @@ TEST(UtilTest, SystemError) {
typedef void (*FormatErrorMessage)( typedef void (*FormatErrorMessage)(
fmt::Writer &out, int error_code, StringRef message); fmt::Writer &out, int error_code, StringRef message);
template <typename Sink>
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 <typename Error> template <typename Error>
void CheckThrowError(int error_code, FormatErrorMessage format) { void CheckThrowError(int error_code, FormatErrorMessage format) {
fmt::SystemError error(0, ""); fmt::SystemError error(0, "");
@ -209,11 +192,6 @@ TEST(UtilTest, FormatSystemErrorMessage) {
GetSystemErrorMessage(EDOM)), message.str()); GetSystemErrorMessage(EDOM)), message.str());
} }
TEST(UtilTest, SystemErrorSink) {
CheckErrorSink<fmt::SystemErrorSink>(
EDOM, fmt::internal::FormatSystemErrorMessage);
}
TEST(UtilTest, ThrowSystemError) { TEST(UtilTest, ThrowSystemError) {
CheckThrowError<fmt::SystemError>(EDOM, fmt::internal::FormatSystemErrorMessage); CheckThrowError<fmt::SystemError>(EDOM, fmt::internal::FormatSystemErrorMessage);
} }
@ -242,11 +220,6 @@ TEST(UtilTest, FormatWinErrorMessage) {
actual_message.str()); actual_message.str());
} }
TEST(UtilTest, WinErrorSink) {
CheckErrorSink<fmt::WinErrorSink>(
ERROR_FILE_EXISTS, fmt::internal::FormatWinErrorMessage);
}
TEST(UtilTest, ThrowWinError) { TEST(UtilTest, ThrowWinError) {
CheckThrowError<fmt::WindowsError>( CheckThrowError<fmt::WindowsError>(
ERROR_FILE_EXISTS, fmt::internal::FormatWinErrorMessage); ERROR_FILE_EXISTS, fmt::internal::FormatWinErrorMessage);