33 ECHO(SimpleObjectTable<T> sot);
34 ECHO(
int id = sot.storeNew(
new T));
42 ECHO(SimpleObjectTable<A> sot);
43 TEST_THROW(sot.storeNew(NULL), NullReferenceError);
51 ECHO(SimpleObjectTable<T> sot);
55 ECHO(
int id = sot.storeRCP(rcpT));
57 ECHO(RCP<T> rcpT2 = sot.getRCP(
id));
65 ECHO(SimpleObjectTable<A> sot);
67 TEST_THROW(sot.storeRCP(rcpA), NullReferenceError);
72 ECHO(SimpleObjectTable<A> sot);
79 ECHO(SimpleObjectTable<A> sot);
88 ECHO(SimpleObjectTable<A> sot);
89 ECHO(
int id = sot.storeNew(
new A));
91 ECHO(sot.removeRCP(
id));
97 ECHO(SimpleObjectTable<A> sot);
99 ECHO(
int id = sot.storeRCP(rcpA));
101 ECHO(sot.removeRCP(
id));
109 ECHO(SimpleObjectTable<A> sot);
116 ECHO(SimpleObjectTable<A> sot);
123 ECHO(SimpleObjectTable<A> sot);
137 ECHO(SimpleObjectTable<A> sot);
144 ECHO(SimpleObjectTable<A> sot);
151 ECHO(SimpleObjectTable<A> sot);
160 ECHO(SimpleObjectTable<A> sot);
161 ECHO(
int id = sot.storeNew(
new A));
163 ECHO(
int id2 = sot.storeNew(
new A));
166 ECHO(sot.removeRCP(
id));
175 ECHO(SimpleObjectTable<T2> sot);
176 ECHO(RCP<T1> rcpT1 =
rcp(
new T1));
177 ECHO(T2 *pT2 = dynamic_cast<T2*>(rcpT1.get()));
179 TEST_THROW(sot.storeCastedRCP(rcpT1), m_bad_cast);
181 ECHO(
int id = sot.storeCastedRCP(rcpT1));
195 ECHO(SimpleObjectTable<A> sot);
196 ECHO(
int id = sot.storeNew(
new A));
209 ECHO(SimpleObjectTable<A> sot);
210 ECHO(
int id = sot.storeNew(
new A));
212 ECHO(sot.removeRCP(
id));
213 ECHO(
int id2 = sot.storeNew(
new A));
219 ECHO(SimpleObjectTable<A> sot);
220 ECHO(
int id = sot.storeNew(
new A));
222 ECHO(
int id2 = sot.storeNew(
new A));
224 ECHO(sot.removeRCP(
id));
225 ECHO(
int id3 = sot.storeNew(
new A));
231 ECHO(SimpleObjectTable<A> sot);
232 ECHO(
int id = sot.storeNew(
new A));
234 ECHO(
int id2 = sot.storeNew(
new A));
236 ECHO(sot.removeRCP(id2));
237 ECHO(
int id3 = sot.storeNew(
new A));
246 ECHO(SimpleObjectTable<A> sot);
248 ECHO(
int id = sot.storeNew(&a,
false));
250 ECHO(RCP<A> rcpA = sot.getRCP(
id));
256 ECHO(
int cnt = sot.removeRCP(
id));
262 ECHO(SimpleObjectTable<A> sot);
264 ECHO(
int id = sot.storeNew(&a,
false));
266 ECHO(RCP<A> rcpA = sot.getRCP(
id));
271 ECHO(
int cnt = sot.removeRCP(
id));
278 ECHO(SimpleObjectTable<A> sot);
279 ECHO(
int id = sot.storeNew(
new A));
281 ECHO(RCP<A> rcpA = sot.getRCP(
id));
286 ECHO(
int cnt = sot.removeRCP(
id));
292 ECHO(SimpleObjectTable<A> sot);
293 ECHO(
int id = sot.storeNew(
new A));
295 ECHO(RCP<A> rcpA = sot.getRCP(
id));
299 ECHO(
int cnt = sot.removeRCP(
id));
306 ECHO(SimpleObjectTable<A> sot);
311 ECHO(
int id = sot.storeRCP(rcpA));
315 ECHO(RCP<A> rcpA2 = sot.getRCP(
id));
323 ECHO(SimpleObjectTable<A> sot);
328 ECHO(
int id = sot.storeRCP(rcpA));
332 ECHO(
int cnt = sot.removeRCP(
id));
338 ECHO(SimpleObjectTable<A> sot);
343 ECHO(
int id = sot.storeRCP(rcpA));
346 ECHO(
int cnt = sot.removeRCP(
id));
353 ECHO(SimpleObjectTable<A> *psot =
new SimpleObjectTable<A>);
355 ECHO(
int id = psot->storeNew(pA));
357 ECHO(RCP<A> rcpA = psot->getRCP(
id));
374 # define DEBUG_UNIT_TEST_GROUP( T ) \
378 # define DEBUG_UNIT_TEST_GROUP( T )
383 #define UNIT_TEST_GROUP( T ) \
384 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectTable, storeNew, T ) \
385 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectTable, storeRCP, T ) \
386 DEBUG_UNIT_TEST_GROUP( T )
388 #define UNIT_TEST_GROUP_PAIR( T1, T2 ) \
389 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( SimpleObjectTable, storeCastedRCP, T1, T2 )
391 #define UNIT_TEST_GROUP_PAIR_SYM( T1, T2 ) \
392 UNIT_TEST_GROUP_PAIR( T1, T2 ) \
393 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.