]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Amend test introduced in #3826 3830/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Sun, 22 Jan 2017 07:00:05 +0000 (08:00 +0100)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Sun, 22 Jan 2017 16:23:05 +0000 (17:23 +0100)
This commit attends to the comments made by @tjhei and @drwells after
#3826 was merged.

tests/trilinos/vector_reference_01.cc
tests/trilinos/vector_reference_01.output

index 79d7a51f2f97d394623dc827059ce7ef6567046e..65fb2ea1ab150aa5e1aadc9567fd9a857961f2cd 100644 (file)
 
 
 // TrilinosWrappers::internal::VectorReference had its non-const copy
-// operator return a const reference. that was non-intuitive but,
+// operator return a const reference. That was non-intuitive but,
 // because of the particular semantics of copying vector reference
-// objects, made no difference. either way, have a check for these
-// semantics
+// objects, made no difference. Either way, we now check these semantics.
 
 #include "../tests.h"
 #include <deal.II/base/utilities.h>
@@ -39,57 +38,28 @@ void test ()
   TrilinosWrappers::internal::VectorReference b (v(1));
   TrilinosWrappers::internal::VectorReference c (v(2));
 
-  // copy VectorReference objects. note that operator= for these
-  // objects does not copy the*content* of the reference object, but
-  // assigns the value of the vector element referenced on the right
-  // to the vector element referenced on the left
+  // Copy the VectorReference objects. Note that operator= for these
+  // objects does not copy the *content* of the reference object, but
+  // rather assigns the value of the vector element referenced on the
+  // right to the vector element referenced on the left.
+  // So the applied operations result in the following actions:
+  // 1. We first assign c to point to where a points (c points to entry 0)
+  // 2. We next assign c to point to where b points (c points to entry 1)
+  // 3. Lastly, we assign b to point to where a points (b points to entry 0)
   (c = a) = b;
   b = a;
 
   deallog << static_cast<TrilinosScalar>(a) << std::endl; // should point to v(0)
   deallog << static_cast<TrilinosScalar>(b) << std::endl; // should point to v(0)
-  deallog << static_cast<TrilinosScalar>(c) << std::endl; // should point to v(0)
+  deallog << static_cast<TrilinosScalar>(c) << std::endl; // should point to v(1)
 }
 
 
 
 int main (int argc,char **argv)
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
-  deallog.threshold_double(1.e-10);
-
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, testing_max_num_threads());
+  MPILogInitAll log;
 
-
-  try
-    {
-      {
-        test ();
-      }
-    }
-  catch (std::exception &exc)
-    {
-      std::cerr << std::endl << std::endl
-                << "----------------------------------------------------"
-                << std::endl;
-      std::cerr << "Exception on processing: " << std::endl
-                << exc.what() << std::endl
-                << "Aborting!" << std::endl
-                << "----------------------------------------------------"
-                << std::endl;
-
-      return 1;
-    }
-  catch (...)
-    {
-      std::cerr << std::endl << std::endl
-                << "----------------------------------------------------"
-                << std::endl;
-      std::cerr << "Unknown exception!" << std::endl
-                << "Aborting!" << std::endl
-                << "----------------------------------------------------"
-                << std::endl;
-      return 1;
-    };
+  test ();
 }
index c1bad75d2c87bbced2836a6e66087db37ccf17e4..1e1d427bec02cac54fee7b18c3e3ab0b5517a178 100644 (file)
@@ -1,4 +1,4 @@
 
-DEAL::0
-DEAL::0
-DEAL::1.00000
+DEAL:0::0.00000
+DEAL:0::0.00000
+DEAL:0::1.00000

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.