]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New test.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 17 Oct 2005 13:37:21 +0000 (13:37 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 17 Oct 2005 13:37:21 +0000 (13:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@11608 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/Makefile
tests/bits/oliver_01.cc [new file with mode: 0644]

index 00f612717a956c567b7f8a9b51cb8446398edbf6..f4a3f99f28773f315a49a835ba5a18671ac32c21 100644 (file)
@@ -70,6 +70,7 @@ tests_x = geometry_info_* \
          nedelec_* \
          get_fe_from_name \
          christian_* \
+         oliver_* \
          accessor_equality*
 
 # tests for the hp branch:
diff --git a/tests/bits/oliver_01.cc b/tests/bits/oliver_01.cc
new file mode 100644 (file)
index 0000000..b3c7357
--- /dev/null
@@ -0,0 +1,44 @@
+//----------------------------  oliver_01.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2005 by the deal.II authors and Oliver Kayser-Herold
+//
+//    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.
+//
+//----------------------------  oliver_01.cc  ---------------------------
+
+
+// Oliver found an example, where sparse_matrix_iterator->value=0 didn't work,
+// because the iterator->value expects a double on the right hand side, not an
+// integer. If the right hand side is zero, it can also be converted to a
+// pointer, which leads to an ambiguity. Fix this by having an additional
+// operator= in the iterator/reference class
+
+#include "../tests.h"
+#include <lac/sparse_matrix.h>
+#include <iostream>
+#include <fstream>
+
+
+int main () 
+{
+  std::ofstream logfile("oliver_01.output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+                                   // this test only needs to compile, not run
+  if (false)
+    {
+      SparseMatrix<double>::iterator *i;
+      (*i)->value () = (int)0;
+    }
+
+  deallog << "OK" << std::endl;
+  
+  return 0;
+}

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.