From: bangerth Date: Wed, 3 Jul 2013 16:04:30 +0000 (+0000) Subject: Another new test. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=203a9d2c76e13cf5d3bb925f5789a5f3054b0e03;p=dealii-svn.git Another new test. git-svn-id: https://svn.dealii.org/trunk@29928 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/deal.II/fe_values_view_invalid_03_nonsymmetric.cc b/tests/deal.II/fe_values_view_invalid_03_nonsymmetric.cc new file mode 100644 index 0000000000..988eb06940 --- /dev/null +++ b/tests/deal.II/fe_values_view_invalid_03_nonsymmetric.cc @@ -0,0 +1,87 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2007, 2008, 2013 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. +// +//---------------------------------------------------------------------- + + +// make sure FEValuesExtractors::Tensor can be default-constructed +// but that it produces an invalid, unusable object + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include + +#include + + + +template +void test (const Triangulation& tr, + const FiniteElement& fe) +{ + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (fe, quadrature, + update_values); + fe_values.reinit (dof.begin_active()); + + FEValuesExtractors::Tensor<2> extr; // invalid object + try + { + fe_values[extr]; // invalid access + } + catch (ExceptionBase &e) + { + deallog << e.get_exc_name() << std::endl; + goto ok; + } + + Assert (false, ExcMessage ("No exception!?")); + + ok: + ; +} + + + +template +void test() +{ + Triangulation tr; + GridGenerator::hyper_cube(tr); + + FESystem fe (FE_Q(1), dim*dim); + test(tr, fe); +} + + +int main() +{ + deal_II_exceptions::disable_abort_on_exception(); + + std::ofstream logfile ("fe_values_view_invalid_03_nonsymmetric/output"); + deallog << std::setprecision (2); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<1>(); + test<2>(); + test<3>(); +} diff --git a/tests/deal.II/fe_values_view_invalid_03_nonsymmetric/cmp/generic b/tests/deal.II/fe_values_view_invalid_03_nonsymmetric/cmp/generic new file mode 100644 index 0000000000..c6a52b9528 --- /dev/null +++ b/tests/deal.II/fe_values_view_invalid_03_nonsymmetric/cmp/generic @@ -0,0 +1,4 @@ + +DEAL::ExcIndexRange (tensor.first_tensor_component, 0, fe_values_views_cache.second_order_tensors.size()) +DEAL::ExcIndexRange (tensor.first_tensor_component, 0, fe_values_views_cache.second_order_tensors.size()) +DEAL::ExcIndexRange (tensor.first_tensor_component, 0, fe_values_views_cache.second_order_tensors.size())