mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 05:22:56 +00:00
Create a branch for working on csrss and co.
svn path=/branches/ros-csrss/; revision=57561
This commit is contained in:
parent
679f8cec0e
commit
65ce146169
20047 changed files with 0 additions and 1175494 deletions
41
lib/3rdparty/stlport/test/unit/shared_ptr_test.cpp
vendored
Normal file
41
lib/3rdparty/stlport/test/unit/shared_ptr_test.cpp
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
#include <memory>
|
||||
|
||||
#if !defined(_STLP_NO_EXTENSIONS) && defined(_STLP_USE_BOOST_SUPPORT)
|
||||
|
||||
// #include <typeinfo>
|
||||
#include "cppunit/cppunit_proxy.h"
|
||||
|
||||
#if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
|
||||
using namespace std;
|
||||
#endif
|
||||
|
||||
class SharedPtrTest :
|
||||
public CPPUNIT_NS::TestCase
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(SharedPtrTest);
|
||||
CPPUNIT_TEST(shared_from_this);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
protected:
|
||||
void shared_from_this();
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(SharedPtrTest);
|
||||
|
||||
struct X;
|
||||
|
||||
struct X :
|
||||
public std::tr1::enable_shared_from_this<X>
|
||||
{
|
||||
};
|
||||
|
||||
void SharedPtrTest::shared_from_this()
|
||||
{
|
||||
std::tr1::shared_ptr<X> p( new X );
|
||||
std::tr1::shared_ptr<X> q = p->shared_from_this();
|
||||
|
||||
CPPUNIT_CHECK( p == q );
|
||||
CPPUNIT_CHECK( !(p < q) && !(q < p) ); // p and q share ownership
|
||||
}
|
||||
|
||||
#endif /* !_STLP_NO_EXTENSIONS && _STLP_USE_BOOST_SUPPORT */
|
Loading…
Add table
Add a link
Reference in a new issue