Lines Matching refs:array
41 // { 1 }, replace with new array
123 void test_copy_ctor(skiatest::Reporter* reporter, SkTArray<T, MEM_MOVE>&& array) {
124 SkASSERT(array.empty());
126 array.emplace_back(new SkRefCnt);
127 REPORTER_ASSERT(reporter, array.back()->unique());
131 SkTArray<T, MEM_MOVE> copy(array);
132 for (const auto& ref : array)
138 for (const auto& ref : array)
298 template <typename Array> static void test_array_reserve(skiatest::Reporter* reporter,
299 Array* array, int reserveCount) {
301 REPORTER_ASSERT(reporter, array->allocCntForTest() >= reserveCount);
302 array->push_back();
303 REPORTER_ASSERT(reporter, array->allocCntForTest() >= reserveCount);
304 array->pop_back();
305 REPORTER_ASSERT(reporter, array->allocCntForTest() >= reserveCount);
306 while (array->count() < reserveCount) {
309 array->push_back();
310 } else if (array->count() > 0) {
311 array->pop_back();
313 REPORTER_ASSERT(reporter, array->allocCntForTest() >= reserveCount);
317 template<typename Array> static void test_reserve(skiatest::Reporter* reporter) {
318 // Test that our allocated space stays >= to the reserve count until the array is filled to
322 Array array1(reserveCount);
326 Array array2;
331 Array array3(reserveCount/2);
335 // Test setting reserve on non-empty array.
336 Array array4;