From 0ab982c9a1901d2286b3424ef2a43a1cf3086f18 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 13 Feb 2006 22:52:16 +0000 Subject: [PATCH] Add a crash test that shouldn't crash. Gotta investigate. git-svn-id: https://svn.dealii.org/trunk@12371 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/hp/Makefile | 5 ++-- tests/hp/crash_01.cc | 63 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 tests/hp/crash_01.cc diff --git a/tests/hp/Makefile b/tests/hp/Makefile index cb96e01930..658b00c5e7 100644 --- a/tests/hp/Makefile +++ b/tests/hp/Makefile @@ -1,6 +1,6 @@ ############################################################ # $Id$ -# Copyright (C) 2000, 2001, 2002, 2003, 2005 by the deal.II authors +# Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006 by the deal.II authors ############################################################ ############################################################ @@ -21,7 +21,8 @@ default: run-tests ############################################################ -tests_x = hp_dof_handler +tests_x = hp_dof_handler \ + crash_* # from above list of regular expressions, generate the real set of # tests diff --git a/tests/hp/crash_01.cc b/tests/hp/crash_01.cc new file mode 100644 index 0000000000..a4e3a9d232 --- /dev/null +++ b/tests/hp/crash_01.cc @@ -0,0 +1,63 @@ +//---------------------------- crash_01.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005, 2006 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------- crash_01.cc --------------------------- + + +// check a crash in hp::DoFHandler<2>::reserve_space found 2/13/2006 + + +#include +#include +#include +#include +#include +#include +#include + +#include + + +int main () +{ + std::ofstream logfile("crash_01/output"); + logfile.precision(2); + + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + { + const unsigned int dim=2; + Triangulation tria; + GridGenerator::hyper_cube(tria); + + hp::FECollection fe_collection; + fe_collection.add_fe (FE_DGQ (1)); + + hp::DoFHandler dof_handler(tria); + dof_handler.distribute_dofs(fe_collection); + } + + { + const unsigned int dim=3; + Triangulation tria; + GridGenerator::hyper_cube(tria); + + hp::FECollection fe_collection; + fe_collection.add_fe (FE_DGQ (1)); + + hp::DoFHandler dof_handler(tria); + dof_handler.distribute_dofs(fe_collection); + } + + deallog << "OK" << std::endl; +} -- 2.39.5