diff --git a/tests/core/timing/TimingTreeTest.cpp b/tests/core/timing/TimingTreeTest.cpp index 862620f326fc8b0eeadcfb55c3b64c6221fd13be..74fa27e046074df0d4eb5923e0e0705545046854 100644 --- a/tests/core/timing/TimingTreeTest.cpp +++ b/tests/core/timing/TimingTreeTest.cpp @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License along // with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file TimingPoolTest.cpp +//! \file TimingTreeTest.cpp //! \ingroup core //! \author Martin Bauer <martin.bauer@fau.de> // @@ -67,12 +67,36 @@ int main( int argc, char ** argv ) tt.stop("AC"); tt.stop("A"); + WALBERLA_ASSERT(tt.timerExists("A")); + WALBERLA_ASSERT(tt.timerExists("A.AA")); + WALBERLA_ASSERT(tt.timerExists("A.AB.ABA")); + WALBERLA_ASSERT(tt.timerExists("A.AB.ABB")); + WALBERLA_ASSERT(tt.timerExists("A.AC.ACA")); + WALBERLA_ASSERT(!tt.timerExists("AAC")); + WALBERLA_ASSERT(!tt.timerExists("A.AA.C")); + // check copy constructor timing::TimingTree<timing::StaticPolicy> tt2(tt); // check assignment operator timing::TimingTree<timing::StaticPolicy> tt3; tt3 = tt; + WALBERLA_ASSERT(tt2.timerExists("A")); + WALBERLA_ASSERT(tt2.timerExists("A.AA")); + WALBERLA_ASSERT(tt2.timerExists("A.AB.ABA")); + WALBERLA_ASSERT(tt2.timerExists("A.AB.ABB")); + WALBERLA_ASSERT(tt2.timerExists("A.AC.ACA")); + WALBERLA_ASSERT(!tt2.timerExists("AAC")); + WALBERLA_ASSERT(!tt2.timerExists("A.AA.C")); + + WALBERLA_ASSERT(tt3.timerExists("A")); + WALBERLA_ASSERT(tt3.timerExists("A.AA")); + WALBERLA_ASSERT(tt3.timerExists("A.AB.ABA")); + WALBERLA_ASSERT(tt3.timerExists("A.AB.ABB")); + WALBERLA_ASSERT(tt3.timerExists("A.AC.ACA")); + WALBERLA_ASSERT(!tt3.timerExists("AAC")); + WALBERLA_ASSERT(!tt3.timerExists("A.AA.C")); + tt2 = tt.getReduced( timing::REDUCE_TOTAL, 0 ); tt2 = tt.getReduced( timing::REDUCE_TOTAL, 1 );