ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

shared_ptr_test.cpp
Go to the documentation of this file.
00001 #include <memory>
00002 
00003 #if !defined(_STLP_NO_EXTENSIONS) && defined(_STLP_USE_BOOST_SUPPORT)
00004 
00005 // #include <typeinfo>
00006 #include "cppunit/cppunit_proxy.h"
00007 
00008 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
00009 using namespace std;
00010 #endif
00011 
00012 class SharedPtrTest :
00013     public CPPUNIT_NS::TestCase
00014 {
00015     CPPUNIT_TEST_SUITE(SharedPtrTest);
00016     CPPUNIT_TEST(shared_from_this);
00017     CPPUNIT_TEST_SUITE_END();
00018 
00019   protected:
00020     void shared_from_this();
00021 };
00022 
00023 CPPUNIT_TEST_SUITE_REGISTRATION(SharedPtrTest);
00024 
00025 struct X;
00026 
00027 struct X :
00028     public std::tr1::enable_shared_from_this<X>
00029 {
00030 };
00031 
00032 void SharedPtrTest::shared_from_this()
00033 {
00034   std::tr1::shared_ptr<X> p( new X );
00035   std::tr1::shared_ptr<X> q = p->shared_from_this();
00036 
00037   CPPUNIT_CHECK( p == q );
00038   CPPUNIT_CHECK( !(p < q) && !(q < p) ); // p and q share ownership
00039 }
00040 
00041 #endif /* !_STLP_NO_EXTENSIONS && _STLP_USE_BOOST_SUPPORT */

Generated on Fri May 25 2012 04:34:14 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.