| Index: webkit/fileapi/media/picasa/pmp_test_helper.cc
|
| diff --git a/webkit/fileapi/media/picasa/pmp_test_helper.cc b/webkit/fileapi/media/picasa/pmp_test_helper.cc
|
| index 69f92ee3881644f941ac77841dcec48f1da8506d..4c09817cfd16ad13954a68d394a31f579518a857 100644
|
| --- a/webkit/fileapi/media/picasa/pmp_test_helper.cc
|
| +++ b/webkit/fileapi/media/picasa/pmp_test_helper.cc
|
| @@ -59,7 +59,7 @@ std::vector<uint8> CombinedVectors(const std::vector<uint8>& a,
|
|
|
| } // namespace
|
|
|
| -PmpTestHelper::PmpTestHelper() { }
|
| +PmpTestHelper::PmpTestHelper() {}
|
|
|
| bool PmpTestHelper::Init() {
|
| return temp_dir_.CreateUniqueTempDir();
|
| @@ -106,7 +106,7 @@ template bool PmpTestHelper::WriteColumnFileFromVector<uint64>(
|
|
|
| bool PmpTestHelper::InitColumnReaderFromBytes(
|
| PmpColumnReader* const reader, const std::vector<uint8>& data,
|
| - uint32* rows_read) {
|
| + const PmpFieldType expected_type, uint32* rows_read) {
|
| DCHECK(temp_dir_.IsValid());
|
|
|
| base::FilePath temp_path;
|
| @@ -116,7 +116,7 @@ bool PmpTestHelper::InitColumnReaderFromBytes(
|
| return false;
|
| }
|
|
|
| - bool success = reader->Init(temp_path, rows_read);
|
| + bool success = reader->Init(temp_path, expected_type, rows_read);
|
|
|
| file_util::Delete(temp_path, true);
|
|
|
| @@ -140,11 +140,14 @@ std::vector<uint8> PmpTestHelper::MakeHeader(const PmpFieldType field_type,
|
| sizeof(picasaimport::kPmpMagic4));
|
|
|
| // Copy in field type.
|
| - memcpy(&header[picasaimport::kPmpFieldType1Offset], &field_type, 2);
|
| - memcpy(&header[picasaimport::kPmpFieldType2Offset], &field_type, 2);
|
| + uint16 field_type_short = static_cast<uint16>(field_type);
|
| + memcpy(&header[picasaimport::kPmpFieldType1Offset], &field_type_short,
|
| + sizeof(uint16));
|
| + memcpy(&header[picasaimport::kPmpFieldType2Offset], &field_type_short,
|
| + sizeof(uint16));
|
|
|
| // Copy in row count.
|
| - memcpy(&header[picasaimport::kPmpRowCountOffset], &row_count, 4);
|
| + memcpy(&header[picasaimport::kPmpRowCountOffset], &row_count, sizeof(uint32));
|
|
|
| return header;
|
| }
|
|
|