67 ECHO(SimpleObjectTable<T> sot);
68 ECHO(
int id = sot.storeNew(
new T));
76 ECHO(SimpleObjectTable<A> sot);
77 TEST_THROW(sot.storeNew(NULL), NullReferenceError);
85 ECHO(SimpleObjectTable<T> sot);
89 ECHO(
int id = sot.storeRCP(rcpT));
91 ECHO(RCP<T> rcpT2 = sot.getRCP(
id));
99 ECHO(SimpleObjectTable<A> sot);
101 TEST_THROW(sot.storeRCP(rcpA), NullReferenceError);
106 ECHO(SimpleObjectTable<A> sot);
113 ECHO(SimpleObjectTable<A> sot);
122 ECHO(SimpleObjectTable<A> sot);
123 ECHO(
int id = sot.storeNew(
new A));
125 ECHO(sot.removeRCP(
id));
131 ECHO(SimpleObjectTable<A> sot);
133 ECHO(
int id = sot.storeRCP(rcpA));
135 ECHO(sot.removeRCP(
id));
143 ECHO(SimpleObjectTable<A> sot);
150 ECHO(SimpleObjectTable<A> sot);
157 ECHO(SimpleObjectTable<A> sot);
171 ECHO(SimpleObjectTable<A> sot);
178 ECHO(SimpleObjectTable<A> sot);
185 ECHO(SimpleObjectTable<A> sot);
194 ECHO(SimpleObjectTable<A> sot);
195 ECHO(
int id = sot.storeNew(
new A));
197 ECHO(
int id2 = sot.storeNew(
new A));
200 ECHO(sot.removeRCP(
id));
209 ECHO(SimpleObjectTable<T2> sot);
210 ECHO(RCP<T1> rcpT1 =
rcp(
new T1));
211 ECHO(T2 *pT2 = dynamic_cast<T2*>(rcpT1.get()));
213 TEST_THROW(sot.storeCastedRCP(rcpT1), m_bad_cast);
215 ECHO(
int id = sot.storeCastedRCP(rcpT1));
229 ECHO(SimpleObjectTable<A> sot);
230 ECHO(
int id = sot.storeNew(
new A));
243 ECHO(SimpleObjectTable<A> sot);
244 ECHO(
int id = sot.storeNew(
new A));
246 ECHO(sot.removeRCP(
id));
247 ECHO(
int id2 = sot.storeNew(
new A));
253 ECHO(SimpleObjectTable<A> sot);
254 ECHO(
int id = sot.storeNew(
new A));
256 ECHO(
int id2 = sot.storeNew(
new A));
258 ECHO(sot.removeRCP(
id));
259 ECHO(
int id3 = sot.storeNew(
new A));
265 ECHO(SimpleObjectTable<A> sot);
266 ECHO(
int id = sot.storeNew(
new A));
268 ECHO(
int id2 = sot.storeNew(
new A));
270 ECHO(sot.removeRCP(id2));
271 ECHO(
int id3 = sot.storeNew(
new A));
280 ECHO(SimpleObjectTable<A> sot);
282 ECHO(
int id = sot.storeNew(&a,
false));
284 ECHO(RCP<A> rcpA = sot.getRCP(
id));
290 ECHO(
int cnt = sot.removeRCP(
id));
296 ECHO(SimpleObjectTable<A> sot);
298 ECHO(
int id = sot.storeNew(&a,
false));
300 ECHO(RCP<A> rcpA = sot.getRCP(
id));
305 ECHO(
int cnt = sot.removeRCP(
id));
312 ECHO(SimpleObjectTable<A> sot);
313 ECHO(
int id = sot.storeNew(
new A));
315 ECHO(RCP<A> rcpA = sot.getRCP(
id));
320 ECHO(
int cnt = sot.removeRCP(
id));
326 ECHO(SimpleObjectTable<A> sot);
327 ECHO(
int id = sot.storeNew(
new A));
329 ECHO(RCP<A> rcpA = sot.getRCP(
id));
333 ECHO(
int cnt = sot.removeRCP(
id));
340 ECHO(SimpleObjectTable<A> sot);
345 ECHO(
int id = sot.storeRCP(rcpA));
349 ECHO(RCP<A> rcpA2 = sot.getRCP(
id));
357 ECHO(SimpleObjectTable<A> sot);
362 ECHO(
int id = sot.storeRCP(rcpA));
366 ECHO(
int cnt = sot.removeRCP(
id));
372 ECHO(SimpleObjectTable<A> sot);
377 ECHO(
int id = sot.storeRCP(rcpA));
380 ECHO(
int cnt = sot.removeRCP(
id));
387 ECHO(SimpleObjectTable<A> *psot =
new SimpleObjectTable<A>);
389 ECHO(
int id = psot->storeNew(pA));
391 ECHO(RCP<A> rcpA = psot->getRCP(
id));
408 # define DEBUG_UNIT_TEST_GROUP( T ) \
412 # define DEBUG_UNIT_TEST_GROUP( T )
417 #define UNIT_TEST_GROUP( T ) \
418 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectTable, storeNew, T ) \
419 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectTable, storeRCP, T ) \
420 DEBUG_UNIT_TEST_GROUP( T )
422 #define UNIT_TEST_GROUP_PAIR( T1, T2 ) \
423 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( SimpleObjectTable, storeCastedRCP, T1, T2 )
425 #define UNIT_TEST_GROUP_PAIR_SYM( T1, T2 ) \
426 UNIT_TEST_GROUP_PAIR( T1, T2 ) \
427 UNIT_TEST_GROUP_PAIR( T2, T1 )
Null reference error exception class.
RCP< T > rcp(const boost::shared_ptr< T > &sptr)
Conversion function that takes in a boost::shared_ptr object and spits out a Teuchos::RCP object...
#define ECHO(statement)
Echo the given statement before it is executed.
This class provides a central place to store objects.
#define TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL(TEST_GROUP, TEST_NAME, TYPE)
Macro for defining a templated unit test with one template parameter.
#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 TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL(TEST_GROUP, TEST_NAME, TYPE1, TYPE2)
Macro for defining a templated unit test with two template parameters.
#define TEUCHOS_UNIT_TEST(TEST_GROUP, TEST_NAME)
Macro for defining a (non-templated) unit test.
bool is_null(const ArrayRCP< T > &p)
Returns true if p.get()==NULL.
#define UNIT_TEST_GROUP_PAIR_SYM(T1, T2)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
#define TEST_EQUALITY_CONST(v1, v2)
Assert the equality of v1 and constant v2.
Exception class for bad cast.
#define UNIT_TEST_GROUP(T)
Smart reference counting pointer class for automatic garbage collection.
#define UNIT_TEST_GROUP_PAIR(T1, T2)
Range error exception class.
Reference-counted pointer class and non-member templated function implementations.
A simple object table class for Teuchos.
bool nonnull(const ArrayRCP< T > &p)
Returns true if p.get()!=NULL.