torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ProgenitorUnitTest.cpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 /// \file
17 /// \brief Unit test for the Progenitor class.
18 
19 #include <boost/test/unit_test.hpp>
22 
23 namespace torc {
24 namespace physical {
25 
26 BOOST_AUTO_TEST_SUITE(physical)
27 
28 /// \cond OMIT_FROM_DOXYGEN
29 class A : public Progenitor<class A> {};
30 /// \endcond
31 
32 /// \brief Unit test for the Progenitor class.
33 BOOST_AUTO_TEST_CASE(ProgenitorUnitTest) {
34  // functions tested:
35  // [null constructor]
36  // void setSelfWeakPtr(WeakPtrType inSelfPtr);
37  // const WeakPtrType& getSelfWeakPtr(void) const;
38  typedef Progenitor<A> progenitor_t;
39  progenitor_t::SharedPtrType progenitorPtr(new A());
40  BOOST_REQUIRE(progenitorPtr.get() != 0);
41  progenitorPtr->setSelfWeakPtr(progenitorPtr);
42  BOOST_CHECK(progenitorPtr->getSelfWeakPtr().lock() == progenitorPtr);
43 }
44 
45 BOOST_AUTO_TEST_SUITE_END()
46 
47 } // namespace physical
48 } // namespace torc
BOOST_AUTO_TEST_CASE(XdlUnpackUnitTest)
Unit test for the XdlUnpack class.
Header for the Progenitor class.
Concept for any object that may have children.
Definition: Progenitor.hpp:36
Header for the Factory class.