]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add tests.
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 23 Aug 2017 17:05:05 +0000 (11:05 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 23 Aug 2017 21:27:00 +0000 (15:27 -0600)
tests/dofs/invalid_iterators_01.cc [new file with mode: 0644]
tests/dofs/invalid_iterators_01.output [new file with mode: 0644]
tests/dofs/invalid_iterators_02.cc [new file with mode: 0644]
tests/dofs/invalid_iterators_02.output [new file with mode: 0644]

diff --git a/tests/dofs/invalid_iterators_01.cc b/tests/dofs/invalid_iterators_01.cc
new file mode 100644 (file)
index 0000000..6122de9
--- /dev/null
@@ -0,0 +1,49 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2017 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+// check that assigning one invalid iterator to another works. this
+// test is for ::DoFHandler
+
+#include "../tests.h"
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/dofs/dof_accessor.h>
+#include <deal.II/grid/tria_iterator.h>
+
+
+template <int dim>
+void check ()
+{
+  typename DoFHandler<dim>::active_cell_iterator invalid_1;
+
+  // try copy constructor
+  typename DoFHandler<dim>::active_cell_iterator invalid_2 = invalid_1;
+
+  // now also try copy operator
+  invalid_1 = invalid_2;
+
+  deallog << "OK" << std::endl;
+}
+
+
+
+int main()
+{
+  initlog();
+
+  check<1>();
+  check<2>();
+  check<3>();
+}
diff --git a/tests/dofs/invalid_iterators_01.output b/tests/dofs/invalid_iterators_01.output
new file mode 100644 (file)
index 0000000..fb71de2
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::OK
+DEAL::OK
+DEAL::OK
diff --git a/tests/dofs/invalid_iterators_02.cc b/tests/dofs/invalid_iterators_02.cc
new file mode 100644 (file)
index 0000000..221355e
--- /dev/null
@@ -0,0 +1,48 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2017 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// check that assigning one invalid iterator to another works. this
+// test is for hp::DoFHandler
+
+#include "../tests.h"
+#include <deal.II/hp/dof_handler.h>
+#include <deal.II/dofs/dof_accessor.h>
+#include <deal.II/grid/tria_iterator.h>
+
+
+template <int dim>
+void check ()
+{
+  typename hp::DoFHandler<dim>::active_cell_iterator invalid_1;
+
+  // try copy constructor
+  typename hp::DoFHandler<dim>::active_cell_iterator invalid_2 = invalid_1;
+
+  // now also try copy operator
+  invalid_1 = invalid_2;
+
+  deallog << "OK" << std::endl;
+}
+
+
+
+int main()
+{
+  initlog();
+
+  check<1>();
+  check<2>();
+  check<3>();
+}
diff --git a/tests/dofs/invalid_iterators_02.output b/tests/dofs/invalid_iterators_02.output
new file mode 100644 (file)
index 0000000..fb71de2
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::OK
+DEAL::OK
+DEAL::OK

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.