From 5f6e1f0fe74bc01878d80531a91c39df9dfaa62a Mon Sep 17 00:00:00 2001 From: "ivan.penkov@gmail.com" Date: Mon, 2 Jul 2012 22:55:57 +0000 Subject: Fixing various compiler warnings and applying minor tweaks to allow running of the mojority of breakpad unittests in Google. http://breakpad.appspot.com/399002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@978 4c0a9323-5329-0410-9bdc-e9ce6186880e --- .../linux_ptrace_dumper_unittest.cc | 23 +++++----------------- 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc') diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc index 5e2b431c..6fabfd84 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc @@ -33,11 +33,13 @@ // This file was renamed from linux_dumper_unittest.cc and modified due // to LinuxDumper being splitted into two classes. +#include #include #include #include #include #include +#include #include #include #include @@ -47,6 +49,7 @@ #include "breakpad_googletest_includes.h" #include "client/linux/minidump_writer/linux_ptrace_dumper.h" +#include "client/linux/minidump_writer/minidump_writer_unittest_utils.h" #include "common/linux/eintr_wrapper.h" #include "common/linux/file_id.h" #include "common/linux/safe_readlink.h" @@ -59,23 +62,6 @@ namespace { typedef testing::Test LinuxPtraceDumperTest; -string GetHelperBinary() { - // Locate helper binary next to the current binary. - char self_path[PATH_MAX]; - if (!SafeReadLink("/proc/self/exe", self_path)) { - return ""; - } - string helper_path(self_path); - size_t pos = helper_path.rfind('/'); - if (pos == string::npos) { - return ""; - } - helper_path.erase(pos + 1); - helper_path += "linux_dumper_unittest_helper"; - - return helper_path; -} - } // namespace TEST(LinuxPtraceDumperTest, Setup) { @@ -134,7 +120,8 @@ TEST(LinuxPtraceDumperTest, MergedMappings) { const size_t kPageSize = sysconf(_SC_PAGESIZE); const size_t kMappingSize = 3 * kPageSize; int fd = open(helper_path.c_str(), O_RDONLY); - ASSERT_NE(-1, fd); + ASSERT_NE(-1, fd) << "Failed to open file: " << helper_path + << ", Error: " << strerror(errno); char* mapping = reinterpret_cast(mmap(NULL, kMappingSize, -- cgit v1.2.1