Commit e23880cc authored by Andrea Valassi's avatar Andrea Valassi
Browse files

Remove debug printouts


git-svn-id: file:///git/lcgcool.svndb/cool/trunk@19408 4525493e-7705-40b1-a816-d608a930855b
parent 355d8bdb
......@@ -170,7 +170,7 @@ public:
virtual ~Derived(){}
};
// Test shared_from_this - succeeds as on Linux
std::cout << std::endl;
//std::cout << std::endl;
{
// See https://social.msdn.microsoft.com/Forums/en-US/4f9a3e69-78ac-4aab-8ab9-e3e16960f76d
// See http://stackoverflow.com/questions/3899790
......@@ -188,8 +188,8 @@ public:
// Test shared_from_this - throws bad_weak_ptr as on MacOSX
{
Derived* pD = new Derived();
std::cout << "Derived* = " << pD << std::endl;
std::cout << "Base* = " << (Base*)pD << std::endl;
//std::cout << "Derived* = " << pD << std::endl;
//std::cout << "Base* = " << (Base*)pD << std::endl;
std::shared_ptr<Base> spB1( (Base*)pD ); // uses ctor<Base> which is a different method than ctor<Derived> within shared_ptr<Base>!
CPPUNIT_ASSERT_EQUAL_MESSAGE( "CountB1 = 1", 1l, spB1.use_count() );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Derived*", pD, dynamic_cast<Derived*>( spB1.get() ) );
......@@ -225,7 +225,7 @@ public:
friend class deleter;
};
// Test shared_from_this - succeeds as on Linux
std::cout << std::endl;
//std::cout << std::endl;
{
std::shared_ptr<Base> spB1( new Derived(), Derived::deleter() ); // two different template arguments, ctor<Derived> within shared_ptr<Base>!
CPPUNIT_ASSERT_EQUAL_MESSAGE( "CountB1 = 1", 1l, spB1.use_count() );
......@@ -241,8 +241,8 @@ public:
// Test shared_from_this - throws bad_weak_ptr as on MacOSX
{
Derived* pD = new Derived();
std::cout << "Derived* = " << pD << std::endl;
std::cout << "Base* = " << (Base*)pD << std::endl;
//std::cout << "Derived* = " << pD << std::endl;
//std::cout << "Base* = " << (Base*)pD << std::endl;
std::shared_ptr<Base> spB1( (Base*)pD ); // uses ctor<Base> which is a different method than ctor<Derived> within shared_ptr<Base>!
CPPUNIT_ASSERT_EQUAL_MESSAGE( "CountB1 = 1", 1l, spB1.use_count() );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Derived*", pD, dynamic_cast<Derived*>( spB1.get() ) );
......@@ -285,7 +285,7 @@ public:
friend class deleter;
};
// Test shared_from_this - succeeds as on Linux
std::cout << std::endl;
//std::cout << std::endl;
{
std::shared_ptr<Base> spB1( new Derived2(), Derived2::deleter() ); // two different template arguments, ctor<Derived2> within shared_ptr<Base>!
CPPUNIT_ASSERT_EQUAL_MESSAGE( "CountB1 = 1", 1l, spB1.use_count() );
......@@ -301,8 +301,8 @@ public:
// Test shared_from_this - throws bad_weak_ptr as on MacOSX
{
Derived2* pD = new Derived2();
std::cout << "Derived2* = " << pD << std::endl;
std::cout << "Base* = " << (Base*)pD << std::endl;
//std::cout << "Derived2* = " << pD << std::endl;
//std::cout << "Base* = " << (Base*)pD << std::endl;
std::shared_ptr<Base> spB1( (Base*)pD ); // uses ctor<Base> which is a different method than ctor<Derived2> within shared_ptr<Base>!
CPPUNIT_ASSERT_EQUAL_MESSAGE( "CountB1 = 1", 1l, spB1.use_count() );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Derived2*", pD, dynamic_cast<Derived2*>( spB1.get() ) );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment