Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimpleObjectDB_UnitTests.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
11 #include "Teuchos_getConst.hpp"
12 
13 #include "TestClasses.hpp"
15 
16 
17 namespace {
18 
19 
20 using Teuchos::null;
21 using Teuchos::RCP;
22 using Teuchos::rcp;
27 using Teuchos::getConst;
28 
29 
30 //
31 // SimpleObjectDB::SimpleObjectDB()
32 //
33 
34 
35 TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL( SimpleObjectDB, defaultConstruct, T )
36 {
37  ECHO(SimpleObjectDB<T> sot);
38  TEST_EQUALITY_CONST(sot.tableSize(), 0);
39  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
40  TEST_EQUALITY_CONST(sot.numObjects(), 0);
41  TEST_THROW(sot.getNonconstObjRCP(0), RangeError);
42  TEST_THROW(sot.getConstObjRCP(0), RangeError);
43  TEST_THROW(sot.getNonconstObjPtr(0), RangeError);
44  TEST_THROW(sot.getConstObjPtr(0), RangeError);
45 }
46 
47 
48 //
49 // createSimpleObjectDB()
50 //
51 
52 
54 {
55  ECHO(RCP<SimpleObjectDB<T> > sot = Teuchos::createSimpleObjectDB<T>());
56  TEST_EQUALITY_CONST(sot->numObjects(), 0);
57 }
58 
59 
60 //
61 // SimpleObjectDB::storeNonconstObj()
62 //
63 
64 
65 TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL( SimpleObjectDB, storeNonconstObj, T )
66 {
67  ECHO(SimpleObjectDB<T> sot);
68  ECHO(const int id = sot.storeNonconstObj(T::create()));
69  TEST_EQUALITY_CONST(sot.tableSize(), 1);
70  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
71  TEST_EQUALITY_CONST(id, 0);
72  TEST_EQUALITY_CONST(nonnull(sot.getNonconstObjRCP(id)), true);
73 }
74 
75 
76 //
77 // SimpleObjectDB::get[Nonconst,Const]Obj[RCP,Ptr]()
78 //
79 
80 
81 TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL( SimpleObjectDB, getNonconstObjRCP, T )
82 {
83  ECHO(SimpleObjectDB<T> sot);
84  ECHO(const RCP<T> obj = T::create());
85  ECHO(const int id = sot.storeNonconstObj(obj));
86  TEST_EQUALITY(obj.get(), sot.getNonconstObjRCP(id).get());
87 }
88 
89 
90 TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL( SimpleObjectDB, getConstObjRCP, T )
91 {
92  ECHO(SimpleObjectDB<T> sot);
93  ECHO(const RCP<T> obj = T::create());
94  ECHO(const int id = sot.storeNonconstObj(obj));
95  TEST_EQUALITY(obj.get(), getConst(sot).getConstObjRCP(id).get());
96 }
97 
98 
99 TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL( SimpleObjectDB, getNonconstObjPtr, T )
100 {
101  ECHO(SimpleObjectDB<T> sot);
102  ECHO(const RCP<T> obj = T::create());
103  ECHO(const int id = sot.storeNonconstObj(obj));
104  TEST_EQUALITY(obj.get(), sot.getNonconstObjPtr(id).get());
105 }
106 
107 
108 TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL( SimpleObjectDB, getConstObjPtr, T )
109 {
110  ECHO(SimpleObjectDB<T> sot);
111  ECHO(const RCP<T> obj = T::create());
112  ECHO(const int id = sot.storeNonconstObj(obj));
113  TEST_EQUALITY(obj.get(), getConst(sot).getConstObjPtr(id).get());
114 }
115 
116 
117 //
118 // SimpleObjectDB::storeConstObj(), getNonconstObjRCP()
119 //
120 
121 
122 TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL( SimpleObjectDB, storeConstObj, T )
123 {
124  ECHO(SimpleObjectDB<T> sot);
125  ECHO(RCP<const T> obj = T::create());
126  ECHO(const int id = sot.storeConstObj(obj));
127  TEST_EQUALITY_CONST(id, 0);
128  TEST_EQUALITY_CONST(sot.tableSize(), 1);
129  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
130  TEST_EQUALITY(sot.getConstObjRCP(id).get(), obj.get());
131  TEST_THROW(sot.getNonconstObjRCP(id), Teuchos::NonconstAccessError);
132 }
133 
134 
135 TEUCHOS_UNIT_TEST( SimpleObjectDB, storeNonconstObjNull1 )
136 {
137  ECHO(SimpleObjectDB<A> sot);
138  ECHO(RCP<A> rcpA);
139  TEST_THROW(sot.storeNonconstObj(rcpA), NullReferenceError);
140  TEST_EQUALITY_CONST(sot.tableSize(), 0);
141  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
142 }
143 
144 
145 TEUCHOS_UNIT_TEST( SimpleObjectDB, storeNonconstObjNull2 )
146 {
147  ECHO(SimpleObjectDB<A> sot);
148  ECHO(A *a=NULL);
149  TEST_THROW(sot.storeNonconstObj(rcp(a)), NullReferenceError);
150  TEST_EQUALITY_CONST(sot.tableSize(), 0);
151  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
152 }
153 
154 
155 TEUCHOS_UNIT_TEST( SimpleObjectDB, storeNonconstObjNull3 )
156 {
157  ECHO(SimpleObjectDB<A> sot);
158  TEST_THROW(sot.storeNonconstObj(Teuchos::null), NullReferenceError);
159  TEST_EQUALITY_CONST(sot.tableSize(), 0);
160  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
161 }
162 
163 
164 //
165 // SimpleObjectDB::remove[Nonconst,Const]Obj()
166 //
167 
168 
169 TEUCHOS_UNIT_TEST( SimpleObjectDB, removeObj_storeNonconstObj_1_0 )
170 {
171  ECHO(SimpleObjectDB<A> sot);
172  ECHO(const RCP<A> obj = A::create());
173  ECHO(const int id1 = sot.storeNonconstObj(obj));
174  TEST_EQUALITY(sot.getNonconstObjRCP(id1).ptr(), obj.ptr());
175  ECHO(sot.removeObj(id1));
176  TEST_EQUALITY_CONST(sot.numObjects(), 0);
177 }
178 
179 
180 TEUCHOS_UNIT_TEST( SimpleObjectDB, removeObj_storeConstObj_1_0 )
181 {
182  ECHO(SimpleObjectDB<A> sot);
183  ECHO(const RCP<A> obj = A::create());
184  ECHO(const int id1 = sot.storeConstObj(obj));
185  TEST_EQUALITY(sot.getConstObjRCP(id1).ptr(), obj.ptr());
186  ECHO(sot.removeObj(id1));
187  TEST_EQUALITY_CONST(sot.numObjects(), 0);
188  ECHO(const int id2 = sot.storeConstObj(obj));
189  TEST_EQUALITY_CONST(id2, 0);
190  TEST_EQUALITY(sot.getConstObjRCP(id2).ptr(), obj.ptr());
191  TEST_EQUALITY_CONST(sot.numObjects(), 1);
192 }
193 
194 
195 TEUCHOS_UNIT_TEST( SimpleObjectDB, removeNonconstObj_storeNonconstObj_1_0 )
196 {
197  ECHO(SimpleObjectDB<A> sot);
198  ECHO(const RCP<A> obj = A::create());
199  ECHO(const int id1 = sot.storeNonconstObj(obj));
200  TEST_EQUALITY(sot.getNonconstObjRCP(id1).ptr(), obj.ptr());
201  ECHO(const RCP<A> obj2 = sot.removeNonconstObj(id1));
202  TEST_EQUALITY(obj2.ptr(), obj.ptr());
203  TEST_EQUALITY_CONST(sot.numObjects(), 0);
204  ECHO(const int id2 = sot.storeNonconstObj(obj));
205  TEST_EQUALITY_CONST(id2, 0);
206  TEST_EQUALITY(sot.getNonconstObjRCP(id2).ptr(), obj.ptr());
207  TEST_EQUALITY_CONST(sot.numObjects(), 1);
208 }
209 
210 
211 TEUCHOS_UNIT_TEST( SimpleObjectDB, removeConstObj_storeConstObj_1_0 )
212 {
213  ECHO(SimpleObjectDB<A> sot);
214  ECHO(const RCP<const A> obj = A::create());
215  ECHO(const int id1 = sot.storeConstObj(obj));
216  TEST_EQUALITY(sot.getConstObjRCP(id1).ptr(), obj.ptr());
217  ECHO(const RCP<const A> obj2 = sot.removeConstObj(id1));
218  TEST_EQUALITY(obj2.ptr(), obj.ptr());
219  TEST_EQUALITY_CONST(sot.numObjects(), 0);
220  ECHO(const int id2 = sot.storeConstObj(obj));
221  TEST_EQUALITY_CONST(id2, 0);
222  TEST_EQUALITY(sot.getConstObjRCP(id2).ptr(), obj.ptr());
223  TEST_EQUALITY_CONST(sot.numObjects(), 1);
224 }
225 
226 
227 #ifdef TEUCHOS_DEBUG
228 
229 
230 TEUCHOS_UNIT_TEST( SimpleObjectDB, removeNonconstObjInvalid1 )
231 {
232  ECHO(SimpleObjectDB<A> sot);
233  ECHO(int id = -1);
234  TEST_THROW(sot.removeNonconstObj(id), RangeError);
235 }
236 
237 
238 TEUCHOS_UNIT_TEST( SimpleObjectDB, removeNonconstObjInvalid2 )
239 {
240  ECHO(SimpleObjectDB<A> sot);
241  ECHO(int id = -2);
242  TEST_THROW(sot.removeNonconstObj(id), RangeError);
243 }
244 
245 
246 TEUCHOS_UNIT_TEST( SimpleObjectDB, removeNonconstObjInvalid3 )
247 {
248  ECHO(SimpleObjectDB<A> sot);
249  ECHO(int id = 0);
250  TEST_THROW(sot.removeNonconstObj(id), RangeError);
251 }
252 
253 
254 TEUCHOS_UNIT_TEST( SimpleObjectDB, removeObjTwice )
255 {
256  ECHO(SimpleObjectDB<A> sot);
257  ECHO(const int id = sot.storeNonconstObj(A::create()));
258  ECHO(sot.removeObj(id));
259  TEST_THROW(sot.removeObj(id), NullReferenceError);
260 }
261 
262 
263 TEUCHOS_UNIT_TEST( SimpleObjectDB, removeNonconstObjTwice )
264 {
265  ECHO(SimpleObjectDB<A> sot);
266  ECHO(const int id = sot.storeNonconstObj(A::create()));
267  ECHO(sot.removeNonconstObj(id));
268  TEST_THROW(sot.removeNonconstObj(id), NullReferenceError);
269 }
270 
271 
272 TEUCHOS_UNIT_TEST( SimpleObjectDB, removeConstObjTwice )
273 {
274  ECHO(SimpleObjectDB<A> sot);
275  ECHO(const int id = sot.storeNonconstObj(A::create()));
276  ECHO(sot.removeConstObj(id));
277  TEST_THROW(sot.removeConstObj(id), NullReferenceError);
278 }
279 
280 
281 #endif // TEUCHOS_DEBUG
282 
283 
284 //
285 // SimpleObjectDB::getNonconstObjRCP()
286 //
287 
288 
289 #ifdef TEUCHOS_DEBUG
290 
291 
292 TEUCHOS_UNIT_TEST( SimpleObjectDB, getNonconstObjRCPInvalid1 )
293 {
294  ECHO(SimpleObjectDB<A> sot);
295  ECHO(int id = -1);
296  TEST_THROW(sot.getNonconstObjRCP(id), RangeError);
297 }
298 
299 TEUCHOS_UNIT_TEST( SimpleObjectDB, getNonconstObjRCPInvalid2 )
300 {
301  ECHO(SimpleObjectDB<A> sot);
302  ECHO(int id = -2);
303  TEST_THROW(sot.getNonconstObjRCP(id), RangeError);
304 }
305 
306 TEUCHOS_UNIT_TEST( SimpleObjectDB, getNonconstObjRCPInvalid3 )
307 {
308  ECHO(SimpleObjectDB<A> sot);
309  ECHO(int id = 0);
310  TEST_THROW(sot.getNonconstObjRCP(id), RangeError);
311 }
312 
313 
314 #endif // TEUCHOS_DEBUG
315 
316 
317 TEUCHOS_UNIT_TEST( SimpleObjectDB, getNonconstObjRCPInvalid4 )
318 {
319  ECHO(SimpleObjectDB<A> sot);
320  ECHO(int id = sot.storeNonconstObj(A::create()));
321  TEST_EQUALITY_CONST(id, 0);
322  ECHO(int id2 = sot.storeNonconstObj(A::create()));
323  TEST_EQUALITY_CONST(id2, 1);
324  ECHO(sot.removeNonconstObj(id));
325  TEST_THROW(sot.getNonconstObjRCP(id), NullReferenceError);
326 }
327 
328 
329 //
330 // SimpleObjectDB::storeCastedNonconstObj()
331 //
332 
333 
334 TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( SimpleObjectDB, storeCastedNonconstObj, T1, T2 )
335 {
336  ECHO(SimpleObjectDB<T2> sot);
337  ECHO(RCP<T1> rcpT1 = rcp(new T1));
338  ECHO(T2 *pT2 = dynamic_cast<T2*>(rcpT1.get()));
339  if (pT2 == NULL) {
340  TEST_THROW(sot.storeCastedNonconstObj(rcpT1), m_bad_cast);
341  } else {
342  ECHO(int id = sot.storeCastedNonconstObj(rcpT1));
343  TEST_EQUALITY_CONST(id, 0);
344  TEST_EQUALITY_CONST(nonnull(sot.getNonconstObjRCP(id)), true);
345  TEST_EQUALITY_CONST(rcpT1.shares_resource(sot.getNonconstObjRCP(id)), true);
346  }
347 }
348 
349 
350 //
351 // SimpleObjectDB::purge()
352 //
353 
354 
355 #ifdef TEUCHOS_DEBUG
356 
357 
358 TEUCHOS_UNIT_TEST( SimpleObjectDB, purge )
359 {
360  ECHO(SimpleObjectDB<A> sot);
361  ECHO(const RCP<A> a(new A));
362  ECHO(int id = sot.storeNonconstObj(a));
363  ECHO(int id2 = sot.storeNonconstObj(a));
364  TEST_EQUALITY_CONST(nonnull(sot.getNonconstObjRCP(id)), true);
365  TEST_EQUALITY_CONST(nonnull(sot.getNonconstObjRCP(id2)), true);
366  TEST_EQUALITY_CONST(sot.tableSize(), 2);
367  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
368  TEST_EQUALITY_CONST(sot.numObjects(), 2);
369  ECHO(sot.removeNonconstObj(id));
370  TEST_EQUALITY_CONST(sot.tableSize(), 2);
371  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 1);
372  TEST_EQUALITY_CONST(sot.numObjects(), 1);
373  ECHO(sot.purge());
374  TEST_EQUALITY_CONST(sot.tableSize(), 0);
375  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
376  TEST_EQUALITY_CONST(sot.numObjects(), 0);
377  TEST_THROW(sot.getNonconstObjRCP(id), RangeError);
378  TEST_EQUALITY_CONST(a.strong_count(), 1); // sot gave up its RCP?
379 }
380 
381 
382 #endif // TEUCHOS_DEBUG
383 
384 
385 //
386 // SimpleObjectDB's freedIndices table
387 //
388 
389 
390 TEUCHOS_UNIT_TEST( SimpleObjectDB, recycleIndex1 )
391 {
392  ECHO(SimpleObjectDB<A> sot);
393  ECHO(int id = sot.storeNonconstObj(A::create()));
394  TEST_EQUALITY_CONST(id, 0);
395  TEST_EQUALITY_CONST(sot.tableSize(), 1);
396  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
397  TEST_EQUALITY_CONST(sot.numObjects(), 1);
398  ECHO(sot.removeNonconstObj(id));
399  TEST_EQUALITY_CONST(sot.tableSize(), 1);
400  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 1);
401  TEST_EQUALITY_CONST(sot.numObjects(), 0);
402  ECHO(int id2 = sot.storeNonconstObj(A::create()));
403  TEST_EQUALITY_CONST(id2, 0);
404  TEST_EQUALITY_CONST(sot.tableSize(), 1);
405  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
406  TEST_EQUALITY_CONST(sot.numObjects(), 1);
407 }
408 
409 
410 TEUCHOS_UNIT_TEST( SimpleObjectDB, recycleIndex2 )
411 {
412  ECHO(SimpleObjectDB<A> sot);
413  ECHO(int id = sot.storeNonconstObj(A::create()));
414  TEST_EQUALITY_CONST(id, 0);
415  ECHO(int id2 = sot.storeNonconstObj(A::create()));
416  TEST_EQUALITY_CONST(id2, 1);
417  TEST_EQUALITY_CONST(sot.tableSize(), 2);
418  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
419  TEST_EQUALITY_CONST(sot.numObjects(), 2);
420  ECHO(sot.removeNonconstObj(id));
421  TEST_EQUALITY_CONST(sot.tableSize(), 2);
422  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 1);
423  TEST_EQUALITY_CONST(sot.numObjects(), 1);
424  ECHO(int id3 = sot.storeNonconstObj(A::create()));
425  TEST_EQUALITY_CONST(id3, 0);
426  TEST_EQUALITY_CONST(sot.tableSize(), 2);
427  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
428  TEST_EQUALITY_CONST(sot.numObjects(), 2);
429 }
430 
431 
432 TEUCHOS_UNIT_TEST( SimpleObjectDB, recycleIndex3 )
433 {
434  ECHO(SimpleObjectDB<A> sot);
435  ECHO(int id = sot.storeNonconstObj(A::create()));
436  TEST_EQUALITY_CONST(id, 0);
437  ECHO(int id2 = sot.storeNonconstObj(A::create()));
438  TEST_EQUALITY_CONST(id2, 1);
439  ECHO(int id3 = sot.storeNonconstObj(A::create()));
440  TEST_EQUALITY_CONST(id3, 2);
441  TEST_EQUALITY_CONST(sot.tableSize(), 3);
442  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
443  TEST_EQUALITY_CONST(sot.numObjects(), 3);
444  ECHO(sot.removeNonconstObj(id2));
445  TEST_EQUALITY_CONST(sot.tableSize(), 3);
446  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 1);
447  TEST_EQUALITY_CONST(sot.numObjects(), 2);
448  ECHO(int id4 = sot.storeNonconstObj(A::create()));
449  TEST_EQUALITY_CONST(id4, 1);
450  TEST_EQUALITY_CONST(sot.tableSize(), 3);
451  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
452  TEST_EQUALITY_CONST(sot.numObjects(), 3);
453  ECHO(int id5 = sot.storeNonconstObj(A::create()));
454  TEST_EQUALITY_CONST(id5, 3);
455  TEST_EQUALITY_CONST(sot.tableSize(), 4);
456  TEST_EQUALITY_CONST(sot.numFreeIndexes(), 0);
457  TEST_EQUALITY_CONST(sot.numObjects(), 4);
458 }
459 
460 
461 //
462 // Template Instantiations
463 //
464 
465 
466 #define UNIT_TEST_GROUP( T ) \
467  TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectDB, defaultConstruct, T ) \
468  TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectDB, createSimpleObjectDB, T ) \
469  TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectDB, storeNonconstObj, T ) \
470  TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectDB, getNonconstObjRCP, T ) \
471  TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectDB, getConstObjRCP, T ) \
472  TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectDB, getNonconstObjPtr, T ) \
473  TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectDB, getConstObjPtr, T ) \
474  TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( SimpleObjectDB, storeConstObj, T )
475 
476 #define UNIT_TEST_GROUP_PAIR( T1, T2 ) \
477  TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( SimpleObjectDB, storeCastedNonconstObj, T1, T2 )
478 
479 #define UNIT_TEST_GROUP_PAIR_SYM( T1, T2 ) \
480  UNIT_TEST_GROUP_PAIR( T1, T2 ) \
481  UNIT_TEST_GROUP_PAIR( T2, T1 )
482 
483 
488 
493 
500 
501 
502 } // namespace
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...
Simple object object database.
#define ECHO(statement)
Echo the given statement before it is executed.
#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 &#39;code&#39; throws the exception &#39;ExceptType&#39; (otherwise the test fails)...
const T & getConst(T &t)
Return a constant reference to an object given a non-const reference.
#define TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL(TEST_GROUP, TEST_NAME, TYPE1, TYPE2)
Macro for defining a templated unit test with two template parameters.
static Teuchos::RCP< A > create()
Definition: TestClasses.hpp:65
#define TEUCHOS_UNIT_TEST(TEST_GROUP, TEST_NAME)
Macro for defining a (non-templated) unit test.
#define UNIT_TEST_GROUP(T)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
#define UNIT_TEST_GROUP_PAIR(T1, T2)
RCP< SimpleObjectDB< T > > createSimpleObjectDB()
Nonmember constructor.
Unit testing support.
#define TEST_EQUALITY_CONST(v1, v2)
Assert the equality of v1 and constant v2.
Exception class for bad cast.
Smart reference counting pointer class for automatic garbage collection.
A simple object table class for Teuchos.
Range error exception class.
#define UNIT_TEST_GROUP_PAIR_SYM(T1, T2)
bool nonnull(const ArrayRCP< T > &p)
Returns true if p.get()!=NULL.
Null reference error exception class.