Skip to content

Commit

Permalink
restore fail func
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud committed Feb 5, 2024
1 parent 8d2b59b commit 7c402e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/logging_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,8 @@ TEST(Logging, FatalThrow) {
# endif // __has_attribute(noreturn)
#endif // defined(__has_attribute)
{ throw std::logic_error{"fail"}; });
EXPECT_THROW(LOG(FATAL) << "must throw to fail", std::logic_error);
InstallFailureFunction(fail_func);
auto restore_fail = [fail_func] { InstallFailureFunction(fail_func); };
ScopedExit<decltype(restore_fail)> restore{restore_fail};
EXPECT_THROW({ LOG(FATAL) << "must throw to fail"; }, std::logic_error);

}

0 comments on commit 7c402e2

Please sign in to comment.