]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Documentation: Update testsuite example snippet to current best practices
authorMatthias Maier <tamiko@43-1.org>
Thu, 20 Aug 2015 14:50:42 +0000 (09:50 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 20 Aug 2015 14:50:42 +0000 (09:50 -0500)
doc/developers/testsuite.html

index c7ce12910702d448b2252e6837a3810bf65d0a64..4397bd4d3eee7420ab3c39835fe98b2765dc8a5a 100644 (file)
@@ -570,7 +570,7 @@ category/test.expect=run.output
 <pre>
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2014 by the deal.II Authors
+// Copyright (C) 2015 by the deal.II Authors
 //
 // This file is part of the deal.II library.
 //
@@ -586,19 +586,17 @@ category/test.expect=run.output
 // a short (a few lines) description of what the program does
 
 #include "../tests.h"
-#include &lt;iostream&gt;
-#include &lt;fstream&gt;
 
 // all include files you need here
 
 int main ()
 {
-  std::ofstream logfile("output");
-  deallog.attach(logfile);
-  deallog.depth_console(0);
+  // Initialize deallog for test output.
+  // This also reroutes deallog output to a file "output".
+  initlog();
 
   // your testcode here:
-  int i=0;
+  int i = 0;
   deallog << i << 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.