Lines Matching refs:deq
11 static void assert_count(skiatest::Reporter* reporter, const SkDeque& deq, int count) { in assert_count() argument
13 REPORTER_ASSERT(reporter, deq.empty()); in assert_count()
14 REPORTER_ASSERT(reporter, 0 == deq.count()); in assert_count()
15 REPORTER_ASSERT(reporter, sizeof(int) == deq.elemSize()); in assert_count()
16 REPORTER_ASSERT(reporter, nullptr == deq.front()); in assert_count()
17 REPORTER_ASSERT(reporter, nullptr == deq.back()); in assert_count()
19 REPORTER_ASSERT(reporter, !deq.empty()); in assert_count()
20 REPORTER_ASSERT(reporter, count == deq.count()); in assert_count()
21 REPORTER_ASSERT(reporter, sizeof(int) == deq.elemSize()); in assert_count()
22 REPORTER_ASSERT(reporter, deq.front()); in assert_count()
23 REPORTER_ASSERT(reporter, deq.back()); in assert_count()
25 REPORTER_ASSERT(reporter, deq.back() == deq.front()); in assert_count()
27 REPORTER_ASSERT(reporter, deq.back() != deq.front()); in assert_count()
32 static void assert_iter(skiatest::Reporter* reporter, const SkDeque& deq, in assert_iter() argument
35 SkDeque::Iter iter(deq, SkDeque::Iter::kFront_IterStart); in assert_iter()
46 iter.reset(deq, SkDeque::Iter::kBack_IterStart); in assert_iter()
56 iter.reset(deq, SkDeque::Iter::kFront_IterStart); in assert_iter()
60 for (int i = 0; i < deq.count()/2 && (ptr = iter.next()); i++) { in assert_iter()
78 DequeUnitTestHelper(const SkDeque& deq) { in DequeUnitTestHelper() argument
79 fNumBlocksAllocated = deq.numBlocksAllocated(); in DequeUnitTestHelper()
84 const SkDeque& deq, in assert_blocks() argument
86 DequeUnitTestHelper helper(deq); in assert_blocks()
88 if (0 == deq.count()) { in assert_blocks()
91 int expected = (deq.count() + allocCount - 1) / allocCount; in assert_blocks()
101 SkDeque deq(sizeof(int), allocCount); in TestSub() local
106 assert_count(reporter, deq, 0); in TestSub()
108 *(int*)deq.push_front() = i; in TestSub()
110 assert_count(reporter, deq, 10); in TestSub()
111 assert_iter(reporter, deq, 10, 1); in TestSub()
112 assert_blocks(reporter, deq, allocCount); in TestSub()
115 deq.pop_front(); in TestSub()
117 assert_count(reporter, deq, 5); in TestSub()
118 assert_iter(reporter, deq, 5, 1); in TestSub()
119 assert_blocks(reporter, deq, allocCount); in TestSub()
122 deq.pop_front(); in TestSub()
124 assert_count(reporter, deq, 0); in TestSub()
125 assert_blocks(reporter, deq, allocCount); in TestSub()
130 *(int*)deq.push_back() = i; in TestSub()
132 assert_count(reporter, deq, 10); in TestSub()
133 assert_iter(reporter, deq, 10, 1); in TestSub()
134 assert_blocks(reporter, deq, allocCount); in TestSub()
137 deq.pop_back(); in TestSub()
139 assert_count(reporter, deq, 5); in TestSub()
140 assert_iter(reporter, deq, 10, 6); in TestSub()
141 assert_blocks(reporter, deq, allocCount); in TestSub()
144 deq.pop_back(); in TestSub()
146 assert_count(reporter, deq, 0); in TestSub()
147 assert_blocks(reporter, deq, allocCount); in TestSub()
151 *(int*)deq.push_front() = 5; in TestSub()
152 *(int*)deq.push_back() = 4; in TestSub()
153 *(int*)deq.push_front() = 6; in TestSub()
154 *(int*)deq.push_back() = 3; in TestSub()
155 *(int*)deq.push_front() = 7; in TestSub()
156 *(int*)deq.push_back() = 2; in TestSub()
157 *(int*)deq.push_front() = 8; in TestSub()
158 *(int*)deq.push_back() = 1; in TestSub()
159 assert_count(reporter, deq, 8); in TestSub()
160 assert_iter(reporter, deq, 8, 1); in TestSub()
161 assert_blocks(reporter, deq, allocCount); in TestSub()