mirror of
https://github.com/boostorg/container.git
synced 2026-01-19 04:02:17 +00:00
Add some new erase tests
This commit is contained in:
@@ -367,6 +367,38 @@ int vector_move_assignable_only(boost::container::dtl::true_type)
|
||||
}
|
||||
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
|
||||
}
|
||||
{
|
||||
//Initialize values
|
||||
IntType aux_vect[50];
|
||||
for(int i = 0; i < 50; ++i){
|
||||
aux_vect[i] = -1;
|
||||
}
|
||||
int aux_vect2[50];
|
||||
for(int i = 0; i < 50; ++i){
|
||||
aux_vect2[i] = -1;
|
||||
}
|
||||
typename MyBoostVector::iterator insert_it =
|
||||
boostvector.insert(boostvector.end()
|
||||
,boost::make_move_iterator(&aux_vect[0])
|
||||
,boost::make_move_iterator(aux_vect + 50));
|
||||
if(boost::container::iterator_udistance(insert_it, boostvector.end()) != 50) return 1;
|
||||
stdvector.insert(stdvector.end(), aux_vect2, aux_vect2 + 50);
|
||||
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
|
||||
|
||||
boostvector.erase(boostvector.begin(), boostvector.begin() + 5);
|
||||
stdvector.erase(stdvector.begin(), stdvector.begin()+5);
|
||||
|
||||
boostvector.erase(boostvector.end() - 5, boostvector.end());
|
||||
stdvector.erase(stdvector.end() - 5, stdvector.end());
|
||||
|
||||
boostvector.erase(boostvector.begin()+5, boostvector.begin() + 10);
|
||||
stdvector.erase(stdvector.begin()+5, stdvector.begin()+10);
|
||||
|
||||
boostvector.erase(boostvector.end() - 10, boostvector.end()-5);
|
||||
stdvector.erase(stdvector.end() - 10, stdvector.end()-5);
|
||||
|
||||
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
|
||||
}
|
||||
{
|
||||
boostvector.resize(100u);
|
||||
stdvector.resize(100u);
|
||||
|
||||
Reference in New Issue
Block a user