#include "Singleton.h" #include class Test { public: size_t index; }; BOOST_AUTO_TEST_CASE(LocalInstance) { auto test = Amass::Singleton::instance(); BOOST_TEST(!test); { auto local = Amass::Singleton::instance(); BOOST_TEST(local); auto refer = Amass::Singleton::instance(); BOOST_TEST(refer); } test = Amass::Singleton::instance(); BOOST_TEST(!test); } BOOST_AUTO_TEST_CASE(GlobalInstance) { auto test = Amass::Singleton::instance(); BOOST_TEST(test); { auto local = Amass::Singleton::instance(); BOOST_TEST(local); auto refer = Amass::Singleton::instance(); BOOST_TEST(refer); } test = Amass::Singleton::instance(); BOOST_TEST(test); }