Fix tests

This commit is contained in:
Victor Zverovich 2017-03-08 07:34:10 -08:00
parent 3610f34c70
commit 7258d1b8f3
2 changed files with 5 additions and 5 deletions

View File

@ -268,10 +268,10 @@ TEST(ExpectTest, EXPECT_SYSTEM_ERROR) {
EXPECT_NONFATAL_FAILURE( EXPECT_NONFATAL_FAILURE(
EXPECT_SYSTEM_ERROR(throw_exception(), EDOM, "test"), EXPECT_SYSTEM_ERROR(throw_exception(), EDOM, "test"),
"Expected: throw_exception() throws an exception of " "Expected: throw_exception() throws an exception of "
"type fmt::SystemError.\n Actual: it throws a different type."); "type fmt::system_error.\n Actual: it throws a different type.");
EXPECT_NONFATAL_FAILURE( EXPECT_NONFATAL_FAILURE(
EXPECT_SYSTEM_ERROR(do_nothing(), EDOM, "test"), EXPECT_SYSTEM_ERROR(do_nothing(), EDOM, "test"),
"Expected: do_nothing() throws an exception of type fmt::SystemError.\n" "Expected: do_nothing() throws an exception of type fmt::system_error.\n"
" Actual: it throws nothing."); " Actual: it throws nothing.");
EXPECT_NONFATAL_FAILURE( EXPECT_NONFATAL_FAILURE(
EXPECT_SYSTEM_ERROR(throw_system_error(), EDOM, "other"), EXPECT_SYSTEM_ERROR(throw_system_error(), EDOM, "other"),

View File

@ -670,10 +670,10 @@ void check_utf_conversion_error(
fmt::basic_string_view<Char> str = fmt::basic_string_view<Char>(0, 0)) { fmt::basic_string_view<Char> str = fmt::basic_string_view<Char>(0, 0)) {
fmt::memory_buffer out; fmt::memory_buffer out;
fmt::internal::format_windows_error(out, ERROR_INVALID_PARAMETER, message); fmt::internal::format_windows_error(out, ERROR_INVALID_PARAMETER, message);
fmt::SystemError error(0, ""); fmt::system_error error(0, "");
try { try {
(Converter)(str); (Converter)(str);
} catch (const fmt::SystemError &e) { } catch (const fmt::system_error &e) {
error = e; error = e;
} }
EXPECT_EQ(ERROR_INVALID_PARAMETER, error.error_code()); EXPECT_EQ(ERROR_INVALID_PARAMETER, error.error_code());
@ -788,7 +788,7 @@ TEST(UtilTest, FormatLongWindowsError) {
} }
TEST(UtilTest, WindowsError) { TEST(UtilTest, WindowsError) {
check_throw_error<fmt::WindowsError>( check_throw_error<fmt::windows_error>(
ERROR_FILE_EXISTS, fmt::internal::format_windows_error); ERROR_FILE_EXISTS, fmt::internal::format_windows_error);
} }