]> https://gitweb.dealii.org/ - dealii.git/commitdiff
One more test.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 26 Aug 2010 09:16:23 +0000 (09:16 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 26 Aug 2010 09:16:23 +0000 (09:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@21717 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/Makefile
tests/base/conditional_ostream.cc [new file with mode: 0644]
tests/base/conditional_ostream/cmp/generic [new file with mode: 0644]

index 0eed0491b58c6fc4a41b5124b0b533ab7f9f0ddb..48cba35a64aafd73976284cb0ecb9d128775004c 100644 (file)
@@ -94,7 +94,8 @@ tests_x =  geometry_info_* \
           task_* \
           parallel_* \
           mutex_* \
-          scalar_*
+          scalar_* \
+          conditional_ostream
 
 # add threading tests. note that we have
 # to list them individually, without wildcards, because the .cc files are
diff --git a/tests/base/conditional_ostream.cc b/tests/base/conditional_ostream.cc
new file mode 100644 (file)
index 0000000..d82a3b5
--- /dev/null
@@ -0,0 +1,39 @@
+//----------------------------  conditional_ostream.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009 by the deal.II authors
+//
+//    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.
+//
+//----------------------------  conditional_ostream.cc  ---------------------------
+
+
+// test the functions of ConditionalOStream
+
+
+#include "../tests.h"
+#include <base/conditional_ostream.h>
+#include <fstream>
+#include <iomanip>
+#include <limits>
+
+
+int main()
+{
+  std::ofstream logfile("conditional_ostream/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+  
+  ConditionalOStream o(logfile, true);
+  o << "Yes" << std::endl;
+  deallog << o.is_active() << std::endl;
+
+  o.set_condition (false);
+  o << "No" << std::endl;
+  deallog << o.is_active() << std::endl;
+}
diff --git a/tests/base/conditional_ostream/cmp/generic b/tests/base/conditional_ostream/cmp/generic
new file mode 100644 (file)
index 0000000..5a09d32
--- /dev/null
@@ -0,0 +1,4 @@
+
+Yes
+DEAL::1
+DEAL::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.