From: Wolfgang Bangerth Date: Wed, 21 Mar 2018 20:09:26 +0000 (-0600) Subject: Add another test. X-Git-Tag: v9.0.0-rc1~287^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6081%2Fhead;p=dealii.git Add another test. --- diff --git a/tests/sparsity/sparsity_pattern_full_matrix_02.cc b/tests/sparsity/sparsity_pattern_full_matrix_02.cc new file mode 100644 index 0000000000..9d1f173ab5 --- /dev/null +++ b/tests/sparsity/sparsity_pattern_full_matrix_02.cc @@ -0,0 +1,53 @@ + +// --------------------------------------------------------------------- +// +// Copyright (C) 2004 - 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 SparsityPattern::copy_from(FullMatrix). The peer review of +// the original patch uncovered a case where we would segfault with +// empty matrices. Cover this in a testcase as well. + +#include "../tests.h" +#include +#include + + +void test (const unsigned int M, + const unsigned int N) +{ + SparsityPattern sp (M,N); + + // fill a full matrix completely + FullMatrix mat(M,N); + for (unsigned int m=0; m