]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a test. 18088/head
authorWasim Niyaz Munshi <munshiw0@gmail.com>
Tue, 4 Feb 2025 23:44:54 +0000 (16:44 -0700)
committerWasim Niyaz Munshi <munshiw0@gmail.com>
Tue, 4 Feb 2025 23:44:54 +0000 (16:44 -0700)
tests/lac/full_matrix_mmult_01.cc [new file with mode: 0644]
tests/lac/full_matrix_mmult_01.expect=run.debug.output [new file with mode: 0644]

diff --git a/tests/lac/full_matrix_mmult_01.cc b/tests/lac/full_matrix_mmult_01.cc
new file mode 100644 (file)
index 0000000..0071cc3
--- /dev/null
@@ -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 <deal.II/lac/full_matrix.h>
+
+#include "../tests.h"
+
+int
+main()
+{
+  initlog();
+
+  try
+    {
+      dealii::FullMatrix<double> A(2, 2);
+      dealii::FullMatrix<double> 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 (file)
index 0000000..e69de29

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.