Lines Matching refs:list

7 //       notice, this list of conditions and the following disclaimer.
9 // copyright notice, this list of conditions and the following
55 // Check that we can add (a reference to) an element of the list
58 // Add elements to the list to grow it to its capacity.
59 List<int, ZeroingAllocationPolicy> list(4);
60 list.Add(1);
61 list.Add(2);
62 list.Add(3);
63 list.Add(4);
66 list.Add(list[0]);
67 CHECK_EQ(1, list[4]);
71 // Test that we can add all elements from a list to another list.
73 List<int, ZeroingAllocationPolicy> list(4);
74 list.Add(0);
75 list.Add(1);
76 list.Add(2);
78 CHECK_EQ(3, list.length());
80 CHECK_EQ(i, list[i]);
85 // Add no elements to list since other_list is empty.
86 list.AddAll(other_list);
87 CHECK_EQ(3, list.length());
89 CHECK_EQ(i, list[i]);
97 // Copy the three elements from other_list to list.
98 list.AddAll(other_list);
99 CHECK_EQ(6, list.length());
101 CHECK_EQ(i % 3, list[i]);
107 List<int> list(4);
108 CHECK_EQ(0, list.length());
109 list.Add(1);
110 CHECK_EQ(1, list.length());
111 CHECK_EQ(1, list.last());
112 list.RemoveLast();
113 CHECK_EQ(0, list.length());
114 list.Add(2);
115 list.Add(3);
116 CHECK_EQ(2, list.length());
117 CHECK_EQ(3, list.last());
118 list.RemoveLast();
119 CHECK_EQ(1, list.length());
120 CHECK_EQ(2, list.last());
121 list.RemoveLast();
122 CHECK_EQ(0, list.length());
125 for (int i = 0; i < kElements; i++) list.Add(i);
127 CHECK_EQ(j + 1, list.length());
128 CHECK_EQ(j, list.last());
129 list.RemoveLast();
130 CHECK_EQ(j, list.length());
136 List<int> list(4);
137 list.Add(1);
138 CHECK_EQ(1, list.length());
139 list.Allocate(100);
140 CHECK_EQ(100, list.length());
141 CHECK_LE(100, list.capacity());
142 list[99] = 123;
143 CHECK_EQ(123, list[99]);
148 List<int> list(4);
149 CHECK_EQ(0, list.length());
150 for (int i = 0; i < 4; ++i) list.Add(i);
151 CHECK_EQ(4, list.length());
152 list.Clear();
153 CHECK_EQ(0, list.length());
159 List<int>* list = new List<int>(0);
160 delete list;
163 List<int> list(0);