aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
diff options
context:
space:
mode:
authorivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-07-02 22:55:57 +0000
committerivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-07-02 22:55:57 +0000
commit5f6e1f0fe74bc01878d80531a91c39df9dfaa62a (patch)
tree4fe7140f6051191e509807d101d224763d5d6d32 /src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
parentChange #imports that should have been #includes to #include. (diff)
downloadbreakpad-5f6e1f0fe74bc01878d80531a91c39df9dfaa62a.tar.xz
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
Diffstat (limited to 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc')
-rw-r--r--src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc23
1 files changed, 5 insertions, 18 deletions
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 <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <unistd.h>
#include <signal.h>
#include <stdint.h>
+#include <string.h>
#include <sys/mman.h>
#include <sys/poll.h>
#include <sys/stat.h>
@@ -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<char*>(mmap(NULL,
kMappingSize,