57using Teuchos::ptrFromRef;
58using Teuchos::rcpFromPtr;
68 ECHO(Ptr<A> a_ptr = ptrFromRef(a));
80 Ptr<A> a_ptr = a_rcp.ptr();
81 Ptr<const A> ca_ptr = a_ptr.getConst();
88 ECHO(RCP<A> a_rcp = rcp(
new A));
89 ECHO(Ptr<A> a_ptr = a_rcp.ptr());
90 ECHO(RCP<A> a_rcp2 = rcpFromPtr(a_ptr));
100 TEST_THROW(a_ptr.getRawPtr(), DanglingReferenceError);
101 TEST_THROW(a_rcp2.getRawPtr(), DanglingReferenceError);
110 ECHO(Ptr<A> a_ptr = ptrFromRef(a));
111 ECHO(RCP<A> a_rcp2 = rcpFromPtr(a_ptr));
119 ECHO(RCP<A> a_rcp2 = rcpFromPtr(a_ptr));
#define TEST_ASSERT(v1)
Assert the given statement is true.
#define TEST_EQUALITY_CONST(v1, v2)
Assert the equality of v1 and constant v2.
#define TEST_EQUALITY(v1, v2)
Assert the equality of v1 and v2.
#define TEST_THROW(code, ExceptType)
Assert that the statement 'code' throws the exception 'ExceptType' (otherwise the test fails).
#define ECHO(statement)
Echo the given statement before it is executed.
#define TEUCHOS_UNIT_TEST(TEST_GROUP, TEST_NAME)
Macro for defining a (non-templated) unit test.
Dangling reference error exception class.
Null reference error exception class.
Simple wrapper class for raw pointers to single objects where no persisting relationship exists.
Smart reference counting pointer class for automatic garbage collection.
bool is_null(const boost::shared_ptr< T > &p)
Returns true if p.get()==NULL.
bool nonnull(const boost::shared_ptr< T > &p)
Returns true if p.get()!=NULL.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.