| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/basictypes.h" | 5 #include <stddef.h> |
| 6 |
| 6 #include "base/containers/mru_cache.h" | 7 #include "base/containers/mru_cache.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 9 |
| 9 namespace { | 10 namespace { |
| 10 | 11 |
| 11 int cached_item_live_count = 0; | 12 int cached_item_live_count = 0; |
| 12 | 13 |
| 13 struct CachedItem { | 14 struct CachedItem { |
| 14 CachedItem() : value(0) { | 15 CachedItem() : value(0) { |
| 15 cached_item_live_count++; | 16 cached_item_live_count++; |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 ASSERT_TRUE(iter != cache2.end()); | 367 ASSERT_TRUE(iter != cache2.end()); |
| 367 EXPECT_EQ(kItem2Key, iter->first); | 368 EXPECT_EQ(kItem2Key, iter->first); |
| 368 EXPECT_EQ(item2.value, iter->second.value); | 369 EXPECT_EQ(item2.value, iter->second.value); |
| 369 | 370 |
| 370 ++iter; | 371 ++iter; |
| 371 ASSERT_TRUE(iter != cache2.end()); | 372 ASSERT_TRUE(iter != cache2.end()); |
| 372 EXPECT_EQ(kItem1Key, iter->first); | 373 EXPECT_EQ(kItem1Key, iter->first); |
| 373 EXPECT_EQ(item1.value, iter->second.value); | 374 EXPECT_EQ(item1.value, iter->second.value); |
| 374 } | 375 } |
| 375 } | 376 } |
| OLD | NEW |