From: Wolfgang Bangerth Date: Wed, 23 Aug 2017 17:05:05 +0000 (-0600) Subject: Add tests. X-Git-Tag: v9.0.0-rc1~1177^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3085c736faa835617f7cbdfbb81eaa905c00736;p=dealii.git Add tests. --- diff --git a/tests/dofs/invalid_iterators_01.cc b/tests/dofs/invalid_iterators_01.cc new file mode 100644 index 0000000000..6122de94f7 --- /dev/null +++ b/tests/dofs/invalid_iterators_01.cc @@ -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 +#include +#include + + +template +void check () +{ + typename DoFHandler::active_cell_iterator invalid_1; + + // try copy constructor + typename DoFHandler::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 index 0000000000..fb71de2867 --- /dev/null +++ b/tests/dofs/invalid_iterators_01.output @@ -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 index 0000000000..221355e59d --- /dev/null +++ b/tests/dofs/invalid_iterators_02.cc @@ -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 +#include +#include + + +template +void check () +{ + typename hp::DoFHandler::active_cell_iterator invalid_1; + + // try copy constructor + typename hp::DoFHandler::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 index 0000000000..fb71de2867 --- /dev/null +++ b/tests/dofs/invalid_iterators_02.output @@ -0,0 +1,4 @@ + +DEAL::OK +DEAL::OK +DEAL::OK