Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: base/containers/mru_cache_unittest.cc

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/basictypes.h"
6 #include "base/containers/mru_cache.h" 6 #include "base/containers/mru_cache.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/googletest/include/gtest/gtest.h"
8 8
9 namespace { 9 namespace {
10 10
11 int cached_item_live_count = 0; 11 int cached_item_live_count = 0;
12 12
13 struct CachedItem { 13 struct CachedItem {
14 CachedItem() : value(0) { 14 CachedItem() : value(0) {
15 cached_item_live_count++; 15 cached_item_live_count++;
16 } 16 }
17 17
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 CachedItem two(2); 263 CachedItem two(2);
264 cache.Put("Second", two); 264 cache.Put("Second", two);
265 265
266 EXPECT_EQ(one.value, cache.Get("First")->second.value); 266 EXPECT_EQ(one.value, cache.Get("First")->second.value);
267 EXPECT_EQ(two.value, cache.Get("Second")->second.value); 267 EXPECT_EQ(two.value, cache.Get("Second")->second.value);
268 cache.ShrinkToSize(1); 268 cache.ShrinkToSize(1);
269 EXPECT_EQ(two.value, cache.Get("Second")->second.value); 269 EXPECT_EQ(two.value, cache.Get("Second")->second.value);
270 EXPECT_TRUE(cache.Get("First") == cache.end()); 270 EXPECT_TRUE(cache.Get("First") == cache.end());
271 } 271 }
OLDNEW
« no previous file with comments | « base/containers/linked_list_unittest.cc ('k') | base/containers/scoped_ptr_hash_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698