diff options
-rw-r--r-- | src/client/linux/minidump_writer/minidump_writer_unittest.cc | 2 | ||||
-rw-r--r-- | src/common/tests/file_utils.cc | 4 | ||||
-rw-r--r-- | src/common/tests/file_utils.h | 3 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/src/client/linux/minidump_writer/minidump_writer_unittest.cc index ac93a343..d192e5cb 100644 --- a/src/client/linux/minidump_writer/minidump_writer_unittest.cc +++ b/src/client/linux/minidump_writer/minidump_writer_unittest.cc @@ -521,7 +521,7 @@ TEST(MinidumpWriterTest, DeletedBinary) { // Copy binary to a temp file. AutoTempDir temp_dir; string binpath = temp_dir.path() + "/linux-dumper-unittest-helper"; - ASSERT_TRUE(CopyFile(helper_path.c_str(), binpath.c_str())) + ASSERT_TRUE(CopyFile(helper_path, binpath)) << "Failed to copy " << helper_path << " to " << binpath; ASSERT_EQ(0, chmod(binpath.c_str(), 0755)); diff --git a/src/common/tests/file_utils.cc b/src/common/tests/file_utils.cc index 1c041777..c1cbb39c 100644 --- a/src/common/tests/file_utils.cc +++ b/src/common/tests/file_utils.cc @@ -96,6 +96,10 @@ bool CopyFile(const char* from_path, const char* to_path) { return result; } +bool CopyFile(const std::string& from_path, const std::string& to_path) { + return CopyFile(from_path.c_str(), to_path.c_str()); +} + bool ReadFile(const char* path, void* buffer, ssize_t* buffer_size) { int fd = HANDLE_EINTR(open(path, O_RDONLY)); if (fd == -1) { diff --git a/src/common/tests/file_utils.h b/src/common/tests/file_utils.h index c98a9bfa..3d1a9c6f 100644 --- a/src/common/tests/file_utils.h +++ b/src/common/tests/file_utils.h @@ -33,9 +33,12 @@ #ifndef COMMON_TESTS_FILE_UTILS_H_ #define COMMON_TESTS_FILE_UTILS_H_ +#include <string> + namespace google_breakpad { // Copies a file from |from_path| to |to_path|. Returns true on success. +bool CopyFile(const std::string& from_path, const std::string& to_path); bool CopyFile(const char* from_path, const char* to_path); // Reads the content of a file at |path| into |buffer|. |buffer_size| specifies |