
#include <OSGBaseInitFunctions.h>
#include <OSGNode.h>
#include <OSGNodeCore.h>
//#include <OSGRefPtr.h>


int main (int argc, char **argv)
{
    OSG::osgInit(argc, argv);


    // Test getting pointers
    OSG::NodeRecPtr node_ptr = OSG::Node::create();
#ifdef OSG_MT_FIELDCONTAINERPTRX
    OSG::Node* node_cptr = get_pointer(node_ptr);
#else
    OSG::Node* node_cptr = node_ptr;
#endif
    
#ifdef OSG_MT_FIELDCONTAINERPTRX
    OSG::NodeRecPtr node_rptr(OSG::Node::create());
    node_cptr = get_pointer(node_rptr);
#endif

    node_ptr = NULL;
}


#include <OSGBaseInitFunctions.h>
#include <OSGNode.h>
#include <OSGNodeCore.h>
//#include <OSGRefPtr.h>


int main (int argc, char **argv)
{
    OSG::osgInit(argc, argv);


    // Test getting pointers
    OSG::NodeRecPtr node_ptr = OSG::Node::create();
#ifdef OSG_MT_FIELDCONTAINERPTRX
    OSG::Node* node_cptr = get_pointer(node_ptr);
#else
    OSG::Node* node_cptr = node_ptr;
#endif
    
#ifdef OSG_MT_FIELDCONTAINERPTRX
    OSG::NodeRecPtr node_rptr(OSG::Node::create());
    node_cptr = get_pointer(node_rptr);
#endif

   // Test Weak ref count ptrs
   {
      OSG::NodeRecPtr node_ptr(OSG::Node::create());
      OSG::NodeWeakPtr node_weak(node_ptr);
      OSG_ASSERT(NULL != node_ptr);
      OSG_ASSERT(NULL != node_weak);

      node_ptr = NULL;

      OSG_ASSERT(NULL == node_ptr);
      OSG_ASSERT(NULL == node_weak);
    }

   {
      OSG::NodeMTRecPtr node_ptr(OSG::Node::create());
      OSG::NodeMTWeakPtr node_weak(node_ptr);
      OSG_ASSERT(NULL != node_ptr);
      OSG_ASSERT(NULL != node_weak);

      node_ptr = NULL;

      OSG_ASSERT(NULL == node_ptr);
      OSG_ASSERT(NULL == node_weak);
    }

    node_ptr = NULL;
}

Add a test to show bug in MTWeakPtr types.
Add a test to show bug in MTWeakPtr types.


git-svn-id: 6c7e10cdde2c115f53707ba8ec4efe535f92d362@1831 4683daeb-ad0f-0410-a623-93161e962ae5
