]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a bunch of tests
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 23 Feb 2006 01:13:17 +0000 (01:13 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 23 Feb 2006 01:13:17 +0000 (01:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@12464 0785d39b-7218-0410-832d-ea1e28bc413d

tests/hp/Makefile
tests/hp/fe_collection_01.cc [new file with mode: 0644]
tests/hp/mapping_collection_01.cc [new file with mode: 0644]
tests/hp/q_collection_01.cc [new file with mode: 0644]

index 658b00c5e744c24856a0aaf470a35241de695159..1f9a74bafc261d0ab0fb77a9bd907f6e703d67d2 100644 (file)
@@ -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 (file)
index 0000000..4e18b95
--- /dev/null
@@ -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 <base/logstream.h>
+#include <fe/fe_collection.h>
+#include <fe/fe_q.h>
+
+#include <fstream>
+
+
+template <int dim>
+void test ()
+{
+  hp::FECollection<dim> fe_collection;
+  fe_collection.push_back (FE_Q<dim>(2));
+  fe_collection.push_back (FE_Q<dim>(3));
+
+                                   // now create a copy and make sure
+                                   // it goes out of scope before the
+                                   // original
+  {
+    hp::FECollection<dim> 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 (file)
index 0000000..dec550b
--- /dev/null
@@ -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 <base/logstream.h>
+#include <fe/mapping_collection.h>
+#include <fe/mapping_q.h>
+#include <fe/mapping_q1.h>
+
+#include <fstream>
+
+
+template <int dim>
+void test ()
+{
+  hp::MappingCollection<dim> mapping_collection;
+  mapping_collection.push_back (MappingQ<dim>(2));
+  mapping_collection.push_back (MappingQ1<dim>());
+
+                                   // now create a copy and make sure
+                                   // it goes out of scope before the
+                                   // original
+  {
+    hp::MappingCollection<dim> 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 (file)
index 0000000..c3c3d71
--- /dev/null
@@ -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 <base/logstream.h>
+#include <base/quadrature_lib.h>
+#include <fe/q_collection.h>
+
+#include <fstream>
+
+
+template <int dim>
+void test ()
+{
+  hp::QCollection<dim> q_collection;
+  q_collection.push_back (QGauss<dim>(2));
+  q_collection.push_back (QGauss<dim>(3));
+
+                                   // now create a copy and make sure
+                                   // it goes out of scope before the
+                                   // original
+  {
+    hp::QCollection<dim> 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;
+}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.