From c39e0c8de2cb8e30b3b7bfa3f75b312f5e75da78 Mon Sep 17 00:00:00 2001 From: Wasim Niyaz Munshi Date: Tue, 4 Feb 2025 16:44:54 -0700 Subject: [PATCH] Add a test. --- tests/lac/full_matrix_mmult_01.cc | 41 +++++++++++++++++++ ...ll_matrix_mmult_01.expect=run.debug.output | 0 2 files changed, 41 insertions(+) create mode 100644 tests/lac/full_matrix_mmult_01.cc create mode 100644 tests/lac/full_matrix_mmult_01.expect=run.debug.output diff --git a/tests/lac/full_matrix_mmult_01.cc b/tests/lac/full_matrix_mmult_01.cc new file mode 100644 index 0000000000..0071cc3ec0 --- /dev/null +++ b/tests/lac/full_matrix_mmult_01.cc @@ -0,0 +1,41 @@ +// ------------------------------------------------------------------------ +// +// SPDX-License-Identifier: LGPL-2.1-or-later +// Copyright (C) 2005 - 2020 by the deal.II authors +// +// This file is part of the deal.II library. +// +// Part of the source code is dual licensed under Apache-2.0 WITH +// LLVM-exception OR LGPL-2.1-or-later. Detailed license information +// governing the source code and code contributions can be found in +// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. +// +// ------------------------------------------------------------------------ + +// Test that an assertion is thrown if output argument of FullMatrix::mmult() is +// also an input argument + +#include + +#include "../tests.h" + +int +main() +{ + initlog(); + + try + { + dealii::FullMatrix A(2, 2); + dealii::FullMatrix B(2, 2); + + // This should trigger an assertion + A.mmult(A, B); + } + catch (const dealii::ExceptionBase &exc) + { + deallog << exc.get_exc_name() << std::endl; + } + + return 0; +} diff --git a/tests/lac/full_matrix_mmult_01.expect=run.debug.output b/tests/lac/full_matrix_mmult_01.expect=run.debug.output new file mode 100644 index 0000000000..e69de29bb2 -- 2.39.5