]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Allow to customize the values used in test_mode
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 26 Feb 2017 14:31:49 +0000 (15:31 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 26 Feb 2017 15:58:12 +0000 (16:58 +0100)
include/deal.II/base/logstream.h
source/base/logstream.cc

index 8398d7ac514d004403bbabe71f678d0ccd9e3099..8e16960b3ff31f74360d63f925b26e705ca74609 100644 (file)
@@ -190,13 +190,16 @@ public:
    * Setup the logstream for regression test mode.
    *
    * This sets the parameters #double_threshold, #float_threshold, and #offset
-   * to nonzero values. The exact values being used have been determined
-   * experimentally and can be found in the source code.
+   * to nonzero values. The default values being used have been determined
+   * experimentally.
    *
    * Called with an argument <tt>false</tt>, switches off test mode and sets
    * all involved parameters to zero.
    */
-  void test_mode (bool on=true);
+  void test_mode (const bool on = true,
+                  const double double_threshold = 1.e-10,
+                  const float float_threshold = 1.e-7f,
+                  const double offset = 1.e-7);
 
 
   /**
index 62d90041df3d2ae85ca99eaed837857ad17a8796..a41544dbb0374edcf760b4ab6dadae419ac7e56d 100644 (file)
@@ -110,14 +110,17 @@ LogStream::~LogStream()
 
 
 void
-LogStream::test_mode(bool on)
+LogStream::test_mode(const bool on,
+                     const double double_threshold_,
+                     const float float_threshold_,
+                     const double offset_)
 {
   Threads::Mutex::ScopedLock lock(log_lock);
   if (on)
     {
-      double_threshold = 1.e-10;
-      float_threshold = 1.e-7f;
-      offset = 1.e-7;
+      double_threshold = double_threshold_;
+      float_threshold = float_threshold_;
+      offset = offset_;
     }
   else
     {

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.