Lines Matching refs:list

7 //       notice, this list of conditions and the following disclaimer.
9 // copyright notice, this list of conditions and the following
54 // Check that we can add (a reference to) an element of the list
57 // Add elements to the list to grow it to its capacity.
58 List<int, ZeroingAllocationPolicy> list(4);
59 list.Add(1);
60 list.Add(2);
61 list.Add(3);
62 list.Add(4);
65 list.Add(list[0]);
66 CHECK_EQ(1, list[4]);
69 // Test that we can add all elements from a list to another list.
71 List<int, ZeroingAllocationPolicy> list(4);
72 list.Add(0);
73 list.Add(1);
74 list.Add(2);
76 CHECK_EQ(3, list.length());
78 CHECK_EQ(i, list[i]);
83 // Add no elements to list since other_list is empty.
84 list.AddAll(other_list);
85 CHECK_EQ(3, list.length());
87 CHECK_EQ(i, list[i]);
95 // Copy the three elements from other_list to list.
96 list.AddAll(other_list);
97 CHECK_EQ(6, list.length());
99 CHECK_EQ(i % 3, list[i]);
105 List<int> list(4);
106 CHECK_EQ(0, list.length());
107 list.Add(1);
108 CHECK_EQ(1, list.length());
109 CHECK_EQ(1, list.last());
110 list.RemoveLast();
111 CHECK_EQ(0, list.length());
112 list.Add(2);
113 list.Add(3);
114 CHECK_EQ(2, list.length());
115 CHECK_EQ(3, list.last());
116 list.RemoveLast();
117 CHECK_EQ(1, list.length());
118 CHECK_EQ(2, list.last());
119 list.RemoveLast();
120 CHECK_EQ(0, list.length());
123 for (int i = 0; i < kElements; i++) list.Add(i);
125 CHECK_EQ(j + 1, list.length());
126 CHECK_EQ(j, list.last());
127 list.RemoveLast();
128 CHECK_EQ(j, list.length());
134 List<int> list(4);
135 CHECK_EQ(0, list.length());
136 for (int i = 0; i < 4; ++i) list.Add(i);
137 CHECK_EQ(4, list.length());
138 list.Clear();
139 CHECK_EQ(0, list.length());
145 List<int>* list = new List<int>(0);
146 delete list;
149 List<int> list(0);