aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/file_id_unittest.cc
diff options
context:
space:
mode:
authorqsr@chromium.org <qsr@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-11-23 14:22:05 +0000
committerqsr@chromium.org <qsr@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-11-23 14:22:05 +0000
commitbad70be095dd93ecc9c28bab90bed0c86fbdedca (patch)
tree6f6a1ac9584f998128dbe5f0e4a4bbc254fb788b /src/common/linux/file_id_unittest.cc
parentRename md5.c to md5.cc, put its contents inside the google_breakpad namespace. (diff)
downloadbreakpad-bad70be095dd93ecc9c28bab90bed0c86fbdedca.tar.xz
Correct compilation warning.
1) Modify src/common/mac/macho_walker.cc to remove a signed vs unsigned comparison. 2) Replace mktemp in test using AutoTmpDir that has been moved from client/mac/tests to common/tests. Review URL: http://breakpad.appspot.com/328001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@888 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/linux/file_id_unittest.cc')
-rw-r--r--src/common/linux/file_id_unittest.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/linux/file_id_unittest.cc b/src/common/linux/file_id_unittest.cc
index 7479a966..977f97d2 100644
--- a/src/common/linux/file_id_unittest.cc
+++ b/src/common/linux/file_id_unittest.cc
@@ -35,6 +35,7 @@
#include "common/linux/file_id.h"
#include "common/linux/synth_elf.h"
#include "common/test_assembler.h"
+#include "common/tests/auto_tempdir.h"
#include "breakpad_googletest_includes.h"
using namespace google_breakpad;
@@ -65,19 +66,19 @@ TEST(FileIDStripTest, StripSelf) {
exe_name[len] = '\0';
// copy our binary to a temp file, and strip it
- char templ[] = "/tmp/file-id-unittest-XXXXXX";
- mktemp(templ);
+ AutoTempDir temp_dir;
+ std::string templ = temp_dir.path() + "/file-id-unittest";
char cmdline[4096];
- sprintf(cmdline, "cp \"%s\" \"%s\"", exe_name, templ);
+ sprintf(cmdline, "cp \"%s\" \"%s\"", exe_name, templ.c_str());
ASSERT_EQ(system(cmdline), 0);
- sprintf(cmdline, "strip \"%s\"", templ);
+ sprintf(cmdline, "strip \"%s\"", templ.c_str());
ASSERT_EQ(system(cmdline), 0);
uint8_t identifier1[sizeof(MDGUID)];
uint8_t identifier2[sizeof(MDGUID)];
FileID fileid1(exe_name);
EXPECT_TRUE(fileid1.ElfFileIdentifier(identifier1));
- FileID fileid2(templ);
+ FileID fileid2(templ.c_str());
EXPECT_TRUE(fileid2.ElfFileIdentifier(identifier2));
char identifier_string1[37];
char identifier_string2[37];
@@ -86,7 +87,6 @@ TEST(FileIDStripTest, StripSelf) {
FileID::ConvertIdentifierToString(identifier2, identifier_string2,
37);
EXPECT_STREQ(identifier_string1, identifier_string2);
- unlink(templ);
}
class FileIDTest : public testing::Test {