mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-03-06 04:22:58 +00:00
Fixing Windows client unit tests. They were broken in r1034 due to gMock and
gTest upgrade. While fixing the broken tests I also used the opportunity to add a few more tests that cover filter and callback execution, and nesting of exception handlers. https://breakpad.appspot.com/489002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1073 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
@@ -35,11 +35,12 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "../../../breakpad_googletest_includes.h"
|
||||
#include "../../../../common/windows/string_utils-inl.h"
|
||||
#include "../crash_generation/crash_generation_server.h"
|
||||
#include "../handler/exception_handler.h"
|
||||
#include "../../../../google_breakpad/processor/minidump.h"
|
||||
#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/exception_handler_test.h"
|
||||
#include "common/windows/string_utils-inl.h"
|
||||
#include "google_breakpad/processor/minidump.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -122,6 +123,10 @@ TEST_F(ExceptionHandlerDeathTest, InProcTest) {
|
||||
new google_breakpad::ExceptionHandler(
|
||||
temp_path_, NULL, &MinidumpWrittenCallback, NULL,
|
||||
google_breakpad::ExceptionHandler::HANDLER_ALL);
|
||||
|
||||
// Disable GTest SEH handler
|
||||
testing::DisableExceptionHandlerInScope disable_exception_handler;
|
||||
|
||||
int *i = NULL;
|
||||
ASSERT_DEATH((*i)++, kSuccessIndicator);
|
||||
delete exc;
|
||||
@@ -141,6 +146,10 @@ void ExceptionHandlerDeathTest::DoCrashAccessViolation() {
|
||||
temp_path_, NULL, NULL, NULL,
|
||||
google_breakpad::ExceptionHandler::HANDLER_ALL, MiniDumpNormal, kPipeName,
|
||||
NULL);
|
||||
|
||||
// Disable GTest SEH handler
|
||||
testing::DisableExceptionHandlerInScope disable_exception_handler;
|
||||
|
||||
// Although this is executing in the child process of the death test,
|
||||
// if it's not true we'll still get an error rather than the crash
|
||||
// being expected.
|
||||
@@ -252,6 +261,9 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemory) {
|
||||
temp_path_, NULL, NULL, NULL,
|
||||
google_breakpad::ExceptionHandler::HANDLER_ALL);
|
||||
|
||||
// Disable GTest SEH handler
|
||||
testing::DisableExceptionHandlerInScope disable_exception_handler;
|
||||
|
||||
// Get some executable memory.
|
||||
const u_int32_t kMemorySize = 256; // bytes
|
||||
const int kOffset = kMemorySize / 2;
|
||||
@@ -334,6 +346,9 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemoryMinBound) {
|
||||
temp_path_, NULL, NULL, NULL,
|
||||
google_breakpad::ExceptionHandler::HANDLER_ALL);
|
||||
|
||||
// Disable GTest SEH handler
|
||||
testing::DisableExceptionHandlerInScope disable_exception_handler;
|
||||
|
||||
SYSTEM_INFO sSysInfo; // Useful information about the system
|
||||
GetSystemInfo(&sSysInfo); // Initialize the structure.
|
||||
|
||||
@@ -421,6 +436,9 @@ TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemoryMaxBound) {
|
||||
temp_path_, NULL, NULL, NULL,
|
||||
google_breakpad::ExceptionHandler::HANDLER_ALL);
|
||||
|
||||
// Disable GTest SEH handler
|
||||
testing::DisableExceptionHandlerInScope disable_exception_handler;
|
||||
|
||||
SYSTEM_INFO sSysInfo; // Useful information about the system
|
||||
GetSystemInfo(&sSysInfo); // Initialize the structure.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user