diff options
author | bcwhite <bcwhite@chromium.org> | 2016-02-22 14:16:10 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-22 22:17:34 +0000 |
commit | 9c5f4e272873a8168060163a2d1d75442ee1436f (patch) | |
tree | f185a385a1fd48ce4679d27fb7235e01c4294adc /base/id_map_unittest.cc | |
parent | ae84e7e3d8c1483af3b2c1c55319594e48b4f9b6 (diff) | |
download | chromium_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.cc | 7 |
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()); } |