mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2025-12-26 01:05:07 +01:00
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
This commit is contained in:
parent
84571a2b91
commit
bad70be095
8 changed files with 157 additions and 133 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue