diff options
Diffstat (limited to 'src/client/windows/unittests/exception_handler_test.cc')
-rw-r--r-- | src/client/windows/unittests/exception_handler_test.cc | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/src/client/windows/unittests/exception_handler_test.cc b/src/client/windows/unittests/exception_handler_test.cc index 9851998e..be9397b8 100644 --- a/src/client/windows/unittests/exception_handler_test.cc +++ b/src/client/windows/unittests/exception_handler_test.cc @@ -27,6 +27,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#include "client/windows/unittests/exception_handler_test.h" + #include <windows.h> #include <dbghelp.h> #include <strsafe.h> @@ -35,12 +37,25 @@ #include <string> -#include "../../../breakpad_googletest_includes.h" -#include "../../../../common/windows/string_utils-inl.h" -#include "../../../../google_breakpad/processor/minidump.h" -#include "../crash_generation/crash_generation_server.h" -#include "../handler/exception_handler.h" -#include "dump_analysis.h" // NOLINT +#include "breakpad_googletest_includes.h" +#include "client/windows/crash_generation/crash_generation_server.h" +#include "client/windows/handler/exception_handler.h" +#include "client/windows/unittests/dump_analysis.h" // NOLINT +#include "common/windows/string_utils-inl.h" +#include "google_breakpad/processor/minidump.h" + +namespace testing { + +DisableExceptionHandlerInScope::DisableExceptionHandlerInScope() { + catch_exceptions_ = GTEST_FLAG(catch_exceptions); + GTEST_FLAG(catch_exceptions) = false; +} + +DisableExceptionHandlerInScope::~DisableExceptionHandlerInScope() { + GTEST_FLAG(catch_exceptions) = catch_exceptions_; +} + +} // namespace testing namespace { @@ -361,6 +376,10 @@ TEST_F(ExceptionHandlerTest, WriteMinidumpTest) { DumpCallback, NULL, ExceptionHandler::HANDLER_ALL); + + // Disable GTest SEH handler + testing::DisableExceptionHandlerInScope disable_exception_handler; + ASSERT_TRUE(handler.WriteMinidump()); ASSERT_FALSE(dump_file.empty()); @@ -396,6 +415,9 @@ TEST_F(ExceptionHandlerTest, AdditionalMemory) { NULL, ExceptionHandler::HANDLER_ALL); + // Disable GTest SEH handler + testing::DisableExceptionHandlerInScope disable_exception_handler; + // Add the memory region to the list of memory to be included. handler.RegisterAppMemory(memory, kMemorySize); ASSERT_TRUE(handler.WriteMinidump()); @@ -447,6 +469,9 @@ TEST_F(ExceptionHandlerTest, AdditionalMemoryRemove) { NULL, ExceptionHandler::HANDLER_ALL); + // Disable GTest SEH handler + testing::DisableExceptionHandlerInScope disable_exception_handler; + // Add the memory region to the list of memory to be included. handler.RegisterAppMemory(memory, kMemorySize); |