Lines Matching refs:map
26 IDMap<TestObject> map;
27 EXPECT_TRUE(map.IsEmpty());
28 EXPECT_EQ(0U, map.size());
33 int32 id1 = map.Add(&obj1);
34 EXPECT_FALSE(map.IsEmpty());
35 EXPECT_EQ(1U, map.size());
36 EXPECT_EQ(&obj1, map.Lookup(id1));
38 int32 id2 = map.Add(&obj2);
39 EXPECT_FALSE(map.IsEmpty());
40 EXPECT_EQ(2U, map.size());
42 EXPECT_EQ(&obj1, map.Lookup(id1));
43 EXPECT_EQ(&obj2, map.Lookup(id2));
45 map.Remove(id1);
46 EXPECT_FALSE(map.IsEmpty());
47 EXPECT_EQ(1U, map.size());
49 map.Remove(id2);
50 EXPECT_TRUE(map.IsEmpty());
51 EXPECT_EQ(0U, map.size());
53 map.AddWithID(&obj1, 1);
54 map.AddWithID(&obj2, 2);
55 EXPECT_EQ(&obj1, map.Lookup(1));
56 EXPECT_EQ(&obj2, map.Lookup(2));
60 IDMap<TestObject> map;
66 map.Add(&obj1);
67 map.Add(&obj2);
68 map.Add(&obj3);
71 IDMap<TestObject>::const_iterator iter(&map);
73 map.Remove(iter.GetCurrentKey());
77 // Test that while an iterator is still in scope, we get the map emptiness
79 EXPECT_TRUE(map.IsEmpty());
80 EXPECT_EQ(0U, map.size());
83 EXPECT_TRUE(map.IsEmpty());
84 EXPECT_EQ(0U, map.size());
88 IDMap<TestObject> map;
95 ids[i] = map.Add(&obj[i]);
98 for (IDMap<TestObject>::const_iterator iter(&map);
104 map.Remove(ids[1]);
109 map.Remove(ids[3]);
114 map.Remove(ids[0]);