Lines Matching refs:v

93     V v(N);  in TestSequentialFor()  local
94 REQUIRE(v.grow_by(0) == v.grow_by(0, move_support_tests::FooWithAssign())); in TestSequentialFor()
97 typename V::iterator p = v.begin(); in TestSequentialFor()
100 for( int i=0; std::size_t(i)<v.size(); ++i, ++p ) { in TestSequentialFor()
104 typename V::difference_type delta = p-v.begin(); in TestSequentialFor()
110 const V& u = v; in TestSequentialFor()
112 REQUIRE( cp == v.cbegin() ); in TestSequentialFor()
115 REQUIRE( (*cp == v.front()) ); in TestSequentialFor()
124 REQUIRE( cp == v.cend() ); in TestSequentialFor()
165 REQUIRE( ((v.begin()+i)[j].bar()==i+j) ); in TestSequentialFor()
166 REQUIRE( ((v.cbegin()+i)[j].bar()==i+j) ); in TestSequentialFor()
168 REQUIRE( ((i+v.begin())[j].bar()==i+j) ); in TestSequentialFor()
169 REQUIRE(((i+v.cbegin())[j].bar()==i+j) ); in TestSequentialFor()
172 CheckIteratorComparison<typename V::iterator, typename V::iterator>(v); in TestSequentialFor()
173 CheckIteratorComparison<typename V::iterator, typename V::const_iterator>(v); in TestSequentialFor()
174 CheckIteratorComparison<typename V::const_iterator, typename V::iterator>(v); in TestSequentialFor()
175 CheckIteratorComparison<typename V::const_iterator, typename V::const_iterator>(v); in TestSequentialFor()
178 TestIteratorAssignment<typename V::const_iterator>( v.begin() ); in TestSequentialFor()
179 TestIteratorAssignment<typename V::const_iterator>( v.cbegin() ); in TestSequentialFor()
180 TestIteratorAssignment<typename V::iterator>( v.begin() ); in TestSequentialFor()
184 TestRangeAssignment<typename V::const_range_type>( v.range() ); in TestSequentialFor()
185 TestRangeAssignment<typename V::range_type>( v.range() ); in TestSequentialFor()
189 typename V::reverse_iterator rp = v.rbegin(); in TestSequentialFor()
190 for( std::size_t i=v.size(); i>0; --i, ++rp ) { in TestSequentialFor()
193 REQUIRE( (rp!=v.rend()) ); in TestSequentialFor()
195 REQUIRE( rp==v.rend() ); in TestSequentialFor()
199 REQUIRE( crp == v.crbegin() ); in TestSequentialFor()
200 REQUIRE( *crp == v.back() ); in TestSequentialFor()
201 for(std::size_t i = v.size(); i>0; --i, ++crp) { in TestSequentialFor()
207 REQUIRE( crp == v.crend() ); in TestSequentialFor()
210 TestIteratorAssignment<typename V::reverse_iterator>( v.rbegin() ); in TestSequentialFor()
249 vector_t v; in TestResizeAndCopy() local
251 v.assign(old_size/2, move_support_tests::Foo() ); in TestResizeAndCopy()
254 REQUIRE( v[j].state == move_support_tests::Foo::CopyInitialized); in TestResizeAndCopy()
257 v.assign(move_support_tests::FooIterator(0), move_support_tests::FooIterator(old_size)); in TestResizeAndCopy()
258 v.resize(new_size, move_support_tests::Foo(33) ); in TestResizeAndCopy()
262 CHECK((v[j].bar()==expected)); in TestResizeAndCopy()
264 REQUIRE( v.size()==std::size_t(new_size) ); in TestResizeAndCopy()
266 v[j].bar() = ~j; in TestResizeAndCopy()
269 const vector_t& cv = v; in TestResizeAndCopy()
274 REQUIRE( !(v != copy_of_v) ); in TestResizeAndCopy()
275 v.clear(); in TestResizeAndCopy()
277 REQUIRE( v.empty() ); in TestResizeAndCopy()
278 swap(v, copy_of_v); in TestResizeAndCopy()
280 CheckVector(v,new_size,old_size); in TestResizeAndCopy()
298 vector_t v(dst_size, move_support_tests::FooWithAssign(), init_alloc); in TestCopyAssignment() local
300 REQUIRE( v[i].state==move_support_tests::Foo::CopyInitialized ); in TestCopyAssignment()
301 v[i].bar() = ~i; in TestCopyAssignment()
303 REQUIRE( v != u ); in TestCopyAssignment()
304 v.swap(u); in TestCopyAssignment()
306 u.swap(v); in TestCopyAssignment()
308 v = u; in TestCopyAssignment()
309 REQUIRE( v == u ); in TestCopyAssignment()
312 REQUIRE( v.size()==std::size_t(src_size) ); in TestCopyAssignment()
314 REQUIRE( v[i].bar()==i ); in TestCopyAssignment()
340 vector_t v; v.reserve(old_size); in TestCapacity() local
341 REQUIRE( v.capacity()>=old_size ); in TestCapacity()
342 v.reserve( new_size ); in TestCapacity()
343 REQUIRE( v.capacity()>=old_size ); in TestCapacity()
344 REQUIRE( v.capacity()>=new_size ); in TestCapacity()
345 REQUIRE( v.empty() ); in TestCapacity()
349 std::size_t j = v.grow_by(1) - v.begin(); in TestCapacity()
351 v[j].bar() = int(~j); in TestCapacity()
353 … vector_t copy_of_v(v); // should allocate first segment with same size as for shrink_to_fit() in TestCapacity()
355 REQUIRE( v.capacity() != copy_of_v.capacity() ); in TestCapacity()
357 v.shrink_to_fit(); in TestCapacity()
358 REQUIRE( v.capacity() == copy_of_v.capacity() ); in TestCapacity()
359 CheckVector(v, new_size*2, old_size); // check vector correctness in TestCapacity()
360 REQUIRE( v==copy_of_v ); // TODO: check also segments layout equality in TestCapacity()
370 std::size_t get_early_size(c_vector & v){ in get_early_size() argument
371 return v.grow_by(0) - v.begin(); in get_early_size()
739 MyVector v(2, move_support_tests::Foo(), MyAllocator()); in TestConcurrentGrowToAtLeastImpl() local
741 …ange<std::size_t>(0, 10000*s, s), GrowToAtLeast<MyVector>(use_two_arg_form, v, copy_from), oneapi:… in TestConcurrentGrowToAtLeastImpl()
744 v.clear(); in TestConcurrentGrowToAtLeastImpl()
745 v.shrink_to_fit(); in TestConcurrentGrowToAtLeastImpl()
746 std::size_t items_allocated = v.get_allocator().items_allocated, in TestConcurrentGrowToAtLeastImpl()
747 items_freed = v.get_allocator().items_freed; in TestConcurrentGrowToAtLeastImpl()
748 std::size_t allocations = v.get_allocator().allocations, in TestConcurrentGrowToAtLeastImpl()
749 frees = v.get_allocator().frees; in TestConcurrentGrowToAtLeastImpl()
784 vector_type v; in TestParallelFor() local
785 v.resize(N); in TestParallelFor()
788 oneapi::tbb::parallel_for(v.range(10000), AssignElement(v.begin())); in TestParallelFor()
790 const vector_type& u = v; in TestParallelFor()
795 for (int i = 0; std::size_t(i) < v.size(); ++i) { in TestParallelFor()
796 if (v[i] != i) { in TestParallelFor()
987 MyVector v(a); in TestConcurrentGrowBy() local
988 …bb::blocked_range<std::size_t>(0, range_size, grain_size), GrowBy<MyVector>(v, m, part_weight), on… in TestConcurrentGrowBy()
990 REQUIRE( v.size() == std::size_t(range_size) ); in TestConcurrentGrowBy()
996 if( v[i].state == move_support_tests::Foo::DefaultInitialized ) ++def_inits; in TestConcurrentGrowBy()
997 else if( v[i].state == move_support_tests::Foo::DirectInitialized ) ++direct_inits; in TestConcurrentGrowBy()
998 else if( v[i].state == move_support_tests::Foo::CopyInitialized ) ++copy_inits; in TestConcurrentGrowBy()
999 else if( v[i].state == move_support_tests::Foo::MoveInitialized ) ++move_inits; in TestConcurrentGrowBy()
1003 intptr_t index = v[i].bar(); in TestConcurrentGrowBy()
1152 vector_t v; member
1158 REQUIRE_MESSAGE(v.empty(),"incorrect test setup?" ); in test()
1159 REQUIRE_THROWS_AS(p_test(v), move_support_tests::FooException); in test()
1160 …REQUIRE_MESSAGE(is_state<move_support_tests::Foo::ZeroInitialized>(v[0]),"incorrectly filled item … in test()
1172 static void test_move_push_back(fixture_t::vector_t& v) { in TestPushBackMoveExceptionSafety()
1174 v.push_back(std::move(f)); in TestPushBackMoveExceptionSafety()
1189 static void test_emplace(fixture_t::vector_t& v) { in TestEmplaceBackExceptionSafety()
1190 v.emplace_back(1,2); in TestEmplaceBackExceptionSafety()
1207 vector_t v; in TestPushBackMoveOnlyContainer() local
1210 v.push_back(std::move(src)); in TestPushBackMoveOnlyContainer()
1211 …REQUIRE_MESSAGE((v[0].my_pointer == &magic_number),"item was incorrectly moved during push_back?"); in TestPushBackMoveOnlyContainer()
1219 std::vector<ComplexType> v; in TestDeductionGuides() local
1224 TVector v1(v.begin(), v.end()); in TestDeductionGuides()
1228 TVector v2(v.begin(), v.end(), std::allocator<ComplexType>()); in TestDeductionGuides()