diff --git a/dune/common/test/shared_ptrtest.cc b/dune/common/test/shared_ptrtest.cc index 6085ce599aa8fc196594ab1b504114788c8a9e70..c5a9ad65544f627d2bdd4671b6606448ef364f7b 100644 --- a/dune/common/test/shared_ptrtest.cc +++ b/dune/common/test/shared_ptrtest.cc @@ -65,6 +65,23 @@ int main(){ // test conversion in make_shared shared_ptr<A> a=test_make_shared(); + { + shared_ptr<B> b(new B); + a=b; + + if(b.use_count()!=2) { + std::cout << "Reference count is wrong! "<<__LINE__<<":"<< + __FILE__<<std::endl; + ret=1; + } + + if(a.use_count()!=2) { + std::cout << "Reference count is wrong! "<<__LINE__<<":"<< + __FILE__<<std::endl; + ret=1; + } + + } // print the type of the shared_ptr, so we know whether we are // checking dune's shared_ptr or some std one std::cout << "=== checking shared_ptr type: " << className(foo)