From: Wolfgang Bangerth Date: Thu, 23 Feb 2006 01:13:17 +0000 (+0000) Subject: Add a bunch of tests X-Git-Tag: v8.0.0~12218 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2009505091a6898de83bc6144a758a61fbde9e32;p=dealii.git Add a bunch of tests git-svn-id: https://svn.dealii.org/trunk@12464 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/hp/Makefile b/tests/hp/Makefile index 658b00c5e7..1f9a74bafc 100644 --- a/tests/hp/Makefile +++ b/tests/hp/Makefile @@ -22,7 +22,10 @@ default: run-tests ############################################################ tests_x = hp_dof_handler \ - crash_* + crash_* \ + q_collection_* \ + mapping_collection_* \ + fe_collection_* # from above list of regular expressions, generate the real set of # tests diff --git a/tests/hp/fe_collection_01.cc b/tests/hp/fe_collection_01.cc new file mode 100644 index 0000000000..4e18b957bd --- /dev/null +++ b/tests/hp/fe_collection_01.cc @@ -0,0 +1,58 @@ +//---------------------------- fe_collection_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. +// +//---------------------------- fe_collection_01.cc --------------------------- + + +// test that QCollection objects are copyable without running into +// troubles when the copy is destroyed earlier than the original +// object + + +#include +#include +#include + +#include + + +template +void test () +{ + hp::FECollection fe_collection; + fe_collection.push_back (FE_Q(2)); + fe_collection.push_back (FE_Q(3)); + + // now create a copy and make sure + // it goes out of scope before the + // original + { + hp::FECollection copy (fe_collection); + } +} + + + +int main () +{ + std::ofstream logfile("fe_collection_01/output"); + logfile.precision(2); + + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1> (); + test<2> (); + test<3> (); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/mapping_collection_01.cc b/tests/hp/mapping_collection_01.cc new file mode 100644 index 0000000000..dec550b439 --- /dev/null +++ b/tests/hp/mapping_collection_01.cc @@ -0,0 +1,59 @@ +//---------------------------- mapping_collection_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. +// +//---------------------------- mapping_collection_01.cc --------------------------- + + +// test that MappingCollection objects are copyable without running into +// troubles when the copy is destroyed earlier than the original +// object + + +#include +#include +#include +#include + +#include + + +template +void test () +{ + hp::MappingCollection mapping_collection; + mapping_collection.push_back (MappingQ(2)); + mapping_collection.push_back (MappingQ1()); + + // now create a copy and make sure + // it goes out of scope before the + // original + { + hp::MappingCollection copy (mapping_collection); + } +} + + + +int main () +{ + std::ofstream logfile("mapping_collection_01/output"); + logfile.precision(2); + + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1> (); + test<2> (); + test<3> (); + + deallog << "OK" << std::endl; +} diff --git a/tests/hp/q_collection_01.cc b/tests/hp/q_collection_01.cc new file mode 100644 index 0000000000..c3c3d71a16 --- /dev/null +++ b/tests/hp/q_collection_01.cc @@ -0,0 +1,58 @@ +//---------------------------- q_collection_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. +// +//---------------------------- q_collection_01.cc --------------------------- + + +// test that QCollection objects are copyable without running into +// troubles when the copy is destroyed earlier than the original +// object + + +#include +#include +#include + +#include + + +template +void test () +{ + hp::QCollection q_collection; + q_collection.push_back (QGauss(2)); + q_collection.push_back (QGauss(3)); + + // now create a copy and make sure + // it goes out of scope before the + // original + { + hp::QCollection copy (q_collection); + } +} + + + +int main () +{ + std::ofstream logfile("q_collection_01/output"); + logfile.precision(2); + + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1> (); + test<2> (); + test<3> (); + + deallog << "OK" << std::endl; +}