first commit

This commit is contained in:
Jose Caban
2025-06-07 11:34:38 -04:00
commit 0eb2d7c07d
4708 changed files with 1500614 additions and 0 deletions

View 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 */