From bad70be095dd93ecc9c28bab90bed0c86fbdedca Mon Sep 17 00:00:00 2001 From: "qsr@chromium.org" Date: Wed, 23 Nov 2011 14:22:05 +0000 Subject: 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 --- src/common/linux/file_id_unittest.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/common/linux') 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 { -- cgit v1.2.1