Chromium Code Reviews| Index: net/disk_cache/simple/simple_index_file_unittest.cc |
| diff --git a/net/disk_cache/simple/simple_index_file_unittest.cc b/net/disk_cache/simple/simple_index_file_unittest.cc |
| index 32afc30acc3bddcb2c92ce3f5aabf981df459886..ef14ce4af2abcc7310a61dd2fa34706974d5dc5e 100644 |
| --- a/net/disk_cache/simple/simple_index_file_unittest.cc |
| +++ b/net/disk_cache/simple/simple_index_file_unittest.cc |
| @@ -52,23 +52,23 @@ TEST_F(IndexMetadataTest, Serialize) { |
| class SimpleIndexFileTest : public testing::Test { |
| public: |
| bool CompareTwoEntryMetadata(const EntryMetadata& a, const EntryMetadata& b) { |
| - return a.hash_key_ == b.hash_key_ && |
| - a.last_used_time_ == b.last_used_time_ && |
| - a.entry_size_ == b.entry_size_; |
| + return a.last_used_time_ == b.last_used_time_ && |
| + a.entry_size_ == b.entry_size_; |
| } |
| }; |
| TEST_F(SimpleIndexFileTest, Serialize) { |
| SimpleIndex::EntrySet entries; |
| + uint64 hashes_array[] = { 11, 22, 33 }; |
| EntryMetadata entries_array[] = { |
|
pasko
2013/05/16 18:13:21
Since we have hashes_array now, to avoid repeating
digit1
2013/05/17 08:45:38
Done.
|
| - EntryMetadata(11, Time::FromInternalValue(22), 33), |
| - EntryMetadata(22, Time::FromInternalValue(33), 44), |
| - EntryMetadata(33, Time::FromInternalValue(44), 55) |
| + EntryMetadata(Time::FromInternalValue(22), 33), |
| + EntryMetadata(Time::FromInternalValue(33), 44), |
| + EntryMetadata(Time::FromInternalValue(44), 55) |
| }; |
| SimpleIndexFile::IndexMetadata index_metadata(arraysize(entries_array), 456); |
| for (uint32 i = 0; i < arraysize(entries_array); ++i) { |
| - SimpleIndex::InsertInEntrySet(entries_array[i], &entries); |
| + SimpleIndex::InsertInEntrySet(hashes_array[i], entries_array[i], &entries); |
| } |
| scoped_ptr<Pickle> pickle = SimpleIndexFile::Serialize( |
| @@ -82,8 +82,7 @@ TEST_F(SimpleIndexFileTest, Serialize) { |
| EXPECT_EQ(entries.size(), new_entries->size()); |
| for (uint32 i = 0; i < arraysize(entries_array); ++i) { |
| - SimpleIndex::EntrySet::iterator it = |
| - new_entries->find(entries_array[i].GetHashKey()); |
| + SimpleIndex::EntrySet::iterator it = new_entries->find(hashes_array[i]); |
| EXPECT_TRUE(new_entries->end() != it); |
| EXPECT_TRUE(CompareTwoEntryMetadata(it->second, entries_array[i])); |
| } |