/** * @author Edouard DUPIN * * @copyright 2011, Edouard DUPIN, all right reserved * * @license APACHE v2.0 (see license file) */ #include #include #undef NAME #define NAME "Shared_ptr" class Example : public ememory::EnableSharedFromThis { protected: int32_t m_id; public: Example() { static int32_t mid = 0; m_id = mid++; std::cout << "create Example [" << m_id << "]" << std::endl; } ~Example() { std::cout << "Remove Example [" << m_id << "]" << std::endl; } }; TEST(TestSTDSharedPtr, testBaseLocal) { Example(); } TEST(TestSTDSharedPtr, testBaseShared) { ememory::SharedPtr tmp = ememory::makeShared(); } TEST(TestSTDSharedPtr, testBaseSharedDouble) { ememory::SharedPtr tmp = ememory::makeShared(); ememory::SharedPtr tmp2 = tmp; } /* TEST(TestSTDSharedPtr, testBaseSharedDirectAndShared) { Example tmp; ememory::SharedPtr tmp2 = ememory::makeShared; } */