From 02f664dbf4450f25f730408e5b98fe63e9a2cdfc Mon Sep 17 00:00:00 2001 From: "digit@chromium.org" Date: Thu, 30 Aug 2012 12:04:52 +0000 Subject: [PATCH] Fix minidump_writer_unittest on Android Android doesn't have /bin/cp, so instead do the copy manually with CopyFile() Review URL: https://breakpad.appspot.com/442002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1022 4c0a9323-5329-0410-9bdc-e9ce6186880e --- .../linux/minidump_writer/minidump_writer_unittest.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/src/client/linux/minidump_writer/minidump_writer_unittest.cc index 1fff015f..7a8d7f17 100644 --- a/src/client/linux/minidump_writer/minidump_writer_unittest.cc +++ b/src/client/linux/minidump_writer/minidump_writer_unittest.cc @@ -46,6 +46,7 @@ #include "common/linux/ignore_ret.h" #include "common/linux/safe_readlink.h" #include "common/tests/auto_tempdir.h" +#include "common/tests/file_utils.h" #include "common/using_std_string.h" #include "google_breakpad/processor/minidump.h" #include "processor/scoped_ptr.h" @@ -328,10 +329,8 @@ TEST(MinidumpWriterTest, DeletedBinary) { // Copy binary to a temp file. AutoTempDir temp_dir; string binpath = temp_dir.path() + "/linux-dumper-unittest-helper"; - char cmdline[2 * PATH_MAX]; - sprintf(cmdline, "/bin/cp \"%s\" \"%s\"", helper_path.c_str(), - binpath.c_str()); - ASSERT_EQ(0, system(cmdline)) << "Failed to execute: " << cmdline; + ASSERT_EQ(true, CopyFile(helper_path.c_str(), binpath.c_str())) \ + << "Failed to copy " << helper_path << " to " << binpath; ASSERT_EQ(0, chmod(binpath.c_str(), 0755)); int fds[2];