Skip to content
Snippets Groups Projects
Commit 5b50a091 authored by Markus Blatt's avatar Markus Blatt
Browse files

Added tests for BlockVector::reserve

parent ccc93ae3
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,23 @@ int testVector()
return 0;
}
void testCapacity()
{
typedef Dune::FieldVector<double,2> SmallVector;
typedef Dune::BlockVector<Dune::BlockVector<SmallVector> > ThreeLevelVector;
ThreeLevelVector vec;
vec.reserve(10);
vec.resize(10);
for(int i=0; i<10; ++i)
vec[i]=Dune::BlockVector<SmallVector>(10);
ThreeLevelVector vec1=vec;
vec.reserve(20, true);
vec.reserve(10, true);
vec.reserve(5, false);
vec.reserve(20, false);
vec.reserve(0, true);
vec1.reserve(0, false);
}
int main()
{
......@@ -124,5 +141,7 @@ int main()
// ret += testVector<3, Dune::PoolAllocator<void,1000000> >();
ret += testVector<3, Dune::DebugAllocator<void> >();
testCapacity();
return ret;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment