From b00b7aa7b37eb7baf4eda50ad447b3ee1d6fe94f Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 12 Jan 2015 21:43:26 +0100 Subject: [PATCH] [DEV] change test program name --- lutin_etktest.py => lutin_etk_test.py | 2 +- test/main.cpp | 1 + test/testStdShared.hpp | 51 +++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) rename lutin_etktest.py => lutin_etk_test.py (88%) create mode 100644 test/testStdShared.hpp diff --git a/lutin_etktest.py b/lutin_etk_test.py similarity index 88% rename from lutin_etktest.py rename to lutin_etk_test.py index ce4fcdc..713aab4 100644 --- a/lutin_etktest.py +++ b/lutin_etk_test.py @@ -9,7 +9,7 @@ def get_desc(): def create(target): # module name is 'edn' and type binary. - myModule = module.Module(__file__, 'etktest', 'BINARY') + myModule = module.Module(__file__, 'etk_test', 'BINARY') # add the file to compile: myModule.add_src_file([ diff --git a/test/main.cpp b/test/main.cpp index 2c5f5a7..b05aded 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -24,6 +24,7 @@ #include "testColor.hpp" #include "testFSNode.hpp" #include "testHash.hpp" +#include "testStdShared.hpp" #undef __class__ #define __class__ "etktest" diff --git a/test/testStdShared.hpp b/test/testStdShared.hpp new file mode 100644 index 0000000..6851535 --- /dev/null +++ b/test/testStdShared.hpp @@ -0,0 +1,51 @@ +/** + * @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" + +#undef __class__ +#define __class__ "etktest" + +class Example : public std::enable_shared_from_this { + 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) { + std::shared_ptr tmp = std::make_shared(); +} + + +TEST(TestSTDSharedPtr, testBaseSharedDouble) { + std::shared_ptr tmp = std::make_shared(); + std::shared_ptr tmp2 = tmp; +} +/* +TEST(TestSTDSharedPtr, testBaseSharedDirectAndShared) { + Example tmp; + std::shared_ptr tmp2 = std::make_shared; +} +*/ \ No newline at end of file