Lines Matching refs:reporter
16 static void TestTSet_basic(skiatest::Reporter* reporter) { in TestTSet_basic() argument
20 REPORTER_ASSERT(reporter, a.empty()); in TestTSet_basic()
21 REPORTER_ASSERT(reporter, a.count() == 0); in TestTSet_basic()
25 REPORTER_ASSERT(reporter, !a.empty()); in TestTSet_basic()
26 REPORTER_ASSERT(reporter, a.count() == 1); in TestTSet_basic()
30 REPORTER_ASSERT(reporter, a.empty()); in TestTSet_basic()
31 REPORTER_ASSERT(reporter, a.count() == 0); in TestTSet_basic()
35 REPORTER_ASSERT(reporter, a.push_back() = 1); in TestTSet_basic()
37 REPORTER_ASSERT(reporter, !a.empty()); in TestTSet_basic()
38 REPORTER_ASSERT(reporter, a.count() == 1); in TestTSet_basic()
39 REPORTER_ASSERT(reporter, a[0] == 1); in TestTSet_basic()
44 REPORTER_ASSERT(reporter, a.count() == SK_ARRAY_COUNT(b)); in TestTSet_basic()
45 REPORTER_ASSERT(reporter, a[2] == 2); in TestTSet_basic()
46 REPORTER_ASSERT(reporter, a[4] == 4); in TestTSet_basic()
50 REPORTER_ASSERT(reporter, a.count() == SK_ARRAY_COUNT(b) - 1); in TestTSet_basic()
51 REPORTER_ASSERT(reporter, a[3] == 3); in TestTSet_basic()
55 REPORTER_ASSERT(reporter, a.count() == SK_ARRAY_COUNT(b) - 2); in TestTSet_basic()
56 REPORTER_ASSERT(reporter, a[0] == 0); in TestTSet_basic()
57 REPORTER_ASSERT(reporter, a[1] == 3); in TestTSet_basic()
58 REPORTER_ASSERT(reporter, a[2] == 2); in TestTSet_basic()
63 template <typename T> static void test_swap(skiatest::Reporter* reporter, in test_swap() argument
83 REPORTER_ASSERT(reporter, b->count() == sizeA); in test_swap()
84 REPORTER_ASSERT(reporter, a->count() == sizeB); in test_swap()
87 for (auto&& x : *b) { REPORTER_ASSERT(reporter, x == curr++); } in test_swap()
88 for (auto&& x : *a) { REPORTER_ASSERT(reporter, x == curr++); } in test_swap()
92 for (auto&& x : *a) { REPORTER_ASSERT(reporter, x == curr++); } in test_swap()
97 static void test_swap(skiatest::Reporter* reporter) { in test_swap() argument
105 test_swap(reporter, arrays, sizes); in test_swap()
119 test_swap(reporter, arraysMoi, sizes); in test_swap()
126 void test_unnecessary_alloc(skiatest::Reporter* reporter) { in test_unnecessary_alloc() argument
129 REPORTER_ASSERT(reporter, a.allocCntForTest() == 0); in test_unnecessary_alloc()
133 REPORTER_ASSERT(reporter, a.allocCntForTest() == 10); in test_unnecessary_alloc()
137 REPORTER_ASSERT(reporter, a.allocCntForTest() >= 1); in test_unnecessary_alloc()
142 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0); in test_unnecessary_alloc()
148 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0); in test_unnecessary_alloc()
153 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0); in test_unnecessary_alloc()
158 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0); in test_unnecessary_alloc()
163 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0); in test_unnecessary_alloc()
168 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0); in test_unnecessary_alloc()
174 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0); in test_unnecessary_alloc()
180 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0); in test_unnecessary_alloc()
184 static void test_self_assignment(skiatest::Reporter* reporter) { in test_self_assignment() argument
187 REPORTER_ASSERT(reporter, !a.empty()); in test_self_assignment()
188 REPORTER_ASSERT(reporter, a.count() == 1); in test_self_assignment()
189 REPORTER_ASSERT(reporter, a[0] == 1); in test_self_assignment()
192 REPORTER_ASSERT(reporter, !a.empty()); in test_self_assignment()
193 REPORTER_ASSERT(reporter, a.count() == 1); in test_self_assignment()
194 REPORTER_ASSERT(reporter, a[0] == 1); in test_self_assignment()
197 template <typename Array> static void test_array_reserve(skiatest::Reporter* reporter, in test_array_reserve() argument
200 REPORTER_ASSERT(reporter, array->allocCntForTest() >= reserveCount); in test_array_reserve()
202 REPORTER_ASSERT(reporter, array->allocCntForTest() >= reserveCount); in test_array_reserve()
204 REPORTER_ASSERT(reporter, array->allocCntForTest() >= reserveCount); in test_array_reserve()
212 REPORTER_ASSERT(reporter, array->allocCntForTest() >= reserveCount); in test_array_reserve()
216 template<typename Array> static void test_reserve(skiatest::Reporter* reporter) { in test_reserve() argument
222 test_array_reserve(reporter, &array1, reserveCount); in test_reserve()
227 test_array_reserve(reporter, &array2, reserveCount); in test_reserve()
232 test_array_reserve(reporter, &array3, reserveCount); in test_reserve()
239 test_array_reserve(reporter, &array4, 2 * reserveCount); in test_reserve()
243 DEF_TEST(TArray, reporter) { in DEF_TEST() argument
244 TestTSet_basic<true>(reporter); in DEF_TEST()
245 TestTSet_basic<false>(reporter); in DEF_TEST()
246 test_swap(reporter); in DEF_TEST()
248 test_unnecessary_alloc(reporter); in DEF_TEST()
250 test_self_assignment(reporter); in DEF_TEST()
252 test_reserve<SkTArray<int>>(reporter); in DEF_TEST()
253 test_reserve<SkSTArray<1, int>>(reporter); in DEF_TEST()
254 test_reserve<SkSTArray<2, int>>(reporter); in DEF_TEST()
255 test_reserve<SkSTArray<16, int>>(reporter); in DEF_TEST()