aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux/handler/exception_handler_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/linux/handler/exception_handler_unittest.cc')
-rw-r--r--src/client/linux/handler/exception_handler_unittest.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc
index a558449f..763adf07 100644
--- a/src/client/linux/handler/exception_handler_unittest.cc
+++ b/src/client/linux/handler/exception_handler_unittest.cc
@@ -60,8 +60,8 @@ const int kGUIDStringSize = 37;
void sigchld_handler(int signo) { }
-int CreateTMPFile(const std::string& dir, std::string* path) {
- std::string file = dir + "/exception-handler-unittest.XXXXXX";
+int CreateTMPFile(const string& dir, string* path) {
+ string file = dir + "/exception-handler-unittest.XXXXXX";
const char* c_file = file.c_str();
// Copy that string, mkstemp needs a C string it can modify.
char* c_path = strdup(c_file);
@@ -98,7 +98,7 @@ void WaitForProcessToTerminate(pid_t process_id, int expected_status) {
}
// Reads the minidump path sent over the pipe |fd| and sets it in |path|.
-void ReadMinidumpPathFromPipe(int fd, std::string* path) {
+void ReadMinidumpPathFromPipe(int fd, string* path) {
struct pollfd pfd;
memset(&pfd, 0, sizeof(pfd));
pfd.fd = fd;
@@ -133,7 +133,7 @@ TEST(ExceptionHandlerTest, SimpleWithPath) {
TEST(ExceptionHandlerTest, SimpleWithFD) {
AutoTempDir temp_dir;
- std::string path;
+ string path;
const int fd = CreateTMPFile(temp_dir.path(), &path);
ExceptionHandler handler(MinidumpDescriptor(fd), NULL, NULL, NULL, true, -1);
close(fd);
@@ -159,7 +159,7 @@ void ChildCrash(bool use_fd) {
AutoTempDir temp_dir;
int fds[2] = {0};
int minidump_fd = -1;
- std::string minidump_path;
+ string minidump_path;
if (use_fd) {
minidump_fd = CreateTMPFile(temp_dir.path(), &minidump_path);
} else {
@@ -169,7 +169,7 @@ void ChildCrash(bool use_fd) {
const pid_t child = fork();
if (child == 0) {
{
- scoped_ptr<ExceptionHandler> handler;
+ google_breakpad::scoped_ptr<ExceptionHandler> handler;
if (use_fd) {
handler.reset(new ExceptionHandler(MinidumpDescriptor(minidump_fd),
NULL, NULL, NULL, true, -1));
@@ -238,6 +238,7 @@ static bool FilterCallbackReturnTrue(void* context) {
// redelivered to this handler. If the child dies with SIGSEGV then it wasn't.
static void RaiseSIGKILL(int sig) {
raise(SIGKILL);
+ return false;
}
static bool InstallRaiseSIGKILL() {
@@ -917,7 +918,7 @@ TEST(ExceptionHandlerTest, WriteMinidumpExceptionStream) {
TEST(ExceptionHandlerTest, GenerateMultipleDumpsWithFD) {
AutoTempDir temp_dir;
- std::string path;
+ string path;
const int fd = CreateTMPFile(temp_dir.path(), &path);
ExceptionHandler handler(MinidumpDescriptor(fd), NULL, NULL, NULL, false, -1);
ASSERT_TRUE(handler.WriteMinidump());
@@ -942,7 +943,7 @@ TEST(ExceptionHandlerTest, GenerateMultipleDumpsWithPath) {
struct stat st;
ASSERT_EQ(0, stat(minidump_1.path(), &st));
ASSERT_GT(st.st_size, 0U);
- std::string minidump_1_path(minidump_1.path());
+ string minidump_1_path(minidump_1.path());
// Check it is a valid minidump.
Minidump minidump1(minidump_1_path);
ASSERT_TRUE(minidump1.Read());
@@ -953,7 +954,7 @@ TEST(ExceptionHandlerTest, GenerateMultipleDumpsWithPath) {
const MinidumpDescriptor& minidump_2 = handler.minidump_descriptor();
ASSERT_EQ(0, stat(minidump_2.path(), &st));
ASSERT_GT(st.st_size, 0U);
- std::string minidump_2_path(minidump_2.path());
+ string minidump_2_path(minidump_2.path());
// Check it is a valid minidump.
Minidump minidump2(minidump_2_path);
ASSERT_TRUE(minidump2.Read());