From: Wolfgang Bangerth Date: Thu, 10 Nov 2016 23:16:52 +0000 (-0700) Subject: Fix memory leaks tests. X-Git-Tag: v8.5.0-rc1~418^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65a120f937c922ec8ac08fb1400b666253d77d8f;p=dealii.git Fix memory leaks tests. --- diff --git a/tests/aniso/up_and_down.cc b/tests/aniso/up_and_down.cc index d081e63fca..cf0639d626 100644 --- a/tests/aniso/up_and_down.cc +++ b/tests/aniso/up_and_down.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 1998 - 2015 by the deal.II authors +// Copyright (C) 1998 - 2016 by the deal.II authors // // This file is part of the deal.II library. // @@ -232,6 +232,11 @@ void test () check_element (tr, *fe_list[i]); } } + + + for (unsigned int i=0; iindex() % 128, ExcInternalError()); } } + + for (typename std::map*>::iterator + p = functions.begin(); + p != functions.end(); ++p) + delete p->second; + deallog << "OK" << std::endl; } diff --git a/tests/fe/fe_q_bubbles.cc b/tests/fe/fe_q_bubbles.cc index 77da76e868..f3fac9af75 100644 --- a/tests/fe/fe_q_bubbles.cc +++ b/tests/fe/fe_q_bubbles.cc @@ -1,7 +1,7 @@ /* --------------------------------------------------------------------- * $Id$ * - * Copyright (C) 1999 - 2015 by the deal.II authors + * Copyright (C) 1999 - 2016 by the deal.II authors * * This file is part of the deal.II library. * @@ -327,26 +327,38 @@ int main () { // { // FiniteElement<2> *fe = new FE_Q<2>(degree); -// Step3<2> laplace_problem(fe, degree); -// laplace_problem.run(); +// { +// Step3<2> laplace_problem(fe, degree); +// laplace_problem.run(); +// } +// delete fe; // } { FiniteElement<2> *fe = new FE_Q_Bubbles<2>(degree); - Step3<2> laplace_problem(fe, degree); - laplace_problem.run(); + { + Step3<2> laplace_problem(fe, degree); + laplace_problem.run(); + } + delete fe; } // { // FiniteElement<3> *fe = new FE_Q<3>(degree); -// Step3<3> laplace_problem(fe, degree); -// laplace_problem.run(); +// { +// Step3<3> laplace_problem(fe, degree); +// laplace_problem.run(); +// } +// delete fe; // } { FiniteElement<3> *fe = new FE_Q_Bubbles<3>(degree); - Step3<3> laplace_problem(fe, degree); - laplace_problem.run(); + { + Step3<3> laplace_problem(fe, degree); + laplace_problem.run(); + } + delete fe; } } return 0; diff --git a/tests/fe/fe_tools_01.cc b/tests/fe/fe_tools_01.cc index b5f9cd47bb..56d002c0a7 100644 --- a/tests/fe/fe_tools_01.cc +++ b/tests/fe/fe_tools_01.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2006 - 2015 by the deal.II authors +// Copyright (C) 2006 - 2016 by the deal.II authors // // This file is part of the deal.II library. // @@ -39,6 +39,8 @@ void test_fe(const char *name) << '\t' << fe->dofs_per_quad << '\t' << fe->dofs_per_hex << std::endl; + + delete fe; } diff --git a/tests/fe/up_and_down.cc b/tests/fe/up_and_down.cc index 6d8e3dda3f..61dc05487f 100644 --- a/tests/fe/up_and_down.cc +++ b/tests/fe/up_and_down.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2013 - 2015 by the deal.II authors +// Copyright (C) 2013 - 2016 by the deal.II authors // // This file is part of the deal.II library. // @@ -236,6 +236,11 @@ void test () deallog << dim << "d, uniform grid, fe #" << i; check_element (tr, *fe_list[i]); } + + + for (unsigned int i=0; i