Fix minidump_module_writer_test 32-bit x86 build.

time_t is a typedef for long on Mac OS X. In 32-bit x86 (ILP32), long is
a signed 32-bit quantity, and its range does not contain the range of
uint32_t, used to store times in time_t fashion in minidump files. A
cast is necessary to make these EXPECT_* macros do the right thing. This
is not a problem in x86_64 (LP64) where long is a signed 64-bit
quantity, which does contain the range of uint32_t.

clang’s error was “error: comparison of integers of different signs:
'const long' and 'const unsigned int' [-Werror,-Wsign-compare]”

BUG=
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/491023005
This commit is contained in:
Mark Mentovai 2014-08-20 18:32:06 -04:00
parent be5d0ab39c
commit 9168ba47ac

View File

@ -132,7 +132,8 @@ void ExpectCodeViewRecord(const MINIDUMP_LOCATION_DESCRIPTOR* codeview_record,
&file_contents[codeview_record->Rva]);
EXPECT_EQ(MinidumpModuleCodeViewRecordPDB20::kSignature,
codeview_pdb20_record->signature);
EXPECT_EQ(expected_pdb_timestamp, codeview_pdb20_record->timestamp);
EXPECT_EQ(static_cast<uint32_t>(expected_pdb_timestamp),
codeview_pdb20_record->timestamp);
EXPECT_EQ(expected_pdb_age, codeview_pdb20_record->age);
observed_pdb_name.assign(