summaryrefslogtreecommitdiffstats
path: root/base/id_map_unittest.cc
diff options
context:
space:
mode:
authorbcwhite <bcwhite@chromium.org>2016-02-22 14:16:10 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-22 22:17:34 +0000
commit9c5f4e272873a8168060163a2d1d75442ee1436f (patch)
treef185a385a1fd48ce4679d27fb7235e01c4294adc /base/id_map_unittest.cc
parentae84e7e3d8c1483af3b2c1c55319594e48b4f9b6 (diff)
downloadchromium_src-9c5f4e272873a8168060163a2d1d75442ee1436f.zip
chromium_src-9c5f4e272873a8168060163a2d1d75442ee1436f.tar.gz
chromium_src-9c5f4e272873a8168060163a2d1d75442ee1436f.tar.bz2
Fix iterators for IDMap with custom key type.
BUG= Review URL: https://codereview.chromium.org/1709223003 Cr-Commit-Position: refs/heads/master@{#376826}
Diffstat (limited to 'base/id_map_unittest.cc')
-rw-r--r--base/id_map_unittest.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/id_map_unittest.cc b/base/id_map_unittest.cc
index 7a07a28..a3f0808 100644
--- a/base/id_map_unittest.cc
+++ b/base/id_map_unittest.cc
@@ -365,6 +365,13 @@ TEST(IDMapTest, Int64KeyType) {
map.AddWithID(&obj1, kId1);
EXPECT_EQ(&obj1, map.Lookup(kId1));
+ IDMap<TestObject, IDMapExternalPointer, int64_t>::const_iterator iter(&map);
+ ASSERT_FALSE(iter.IsAtEnd());
+ EXPECT_EQ(kId1, iter.GetCurrentKey());
+ EXPECT_EQ(&obj1, iter.GetCurrentValue());
+ iter.Advance();
+ ASSERT_TRUE(iter.IsAtEnd());
+
map.Remove(kId1);
EXPECT_TRUE(map.IsEmpty());
}