From: Daniel Arndt Date: Sun, 26 Feb 2017 14:31:49 +0000 (+0100) Subject: Allow to customize the values used in test_mode X-Git-Tag: v8.5.0-rc1~92^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a609938e0a2c07ea66de2cf09188432bc65e3f2;p=dealii.git Allow to customize the values used in test_mode --- diff --git a/include/deal.II/base/logstream.h b/include/deal.II/base/logstream.h index 8398d7ac51..8e16960b3f 100644 --- a/include/deal.II/base/logstream.h +++ b/include/deal.II/base/logstream.h @@ -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 false, 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); /** diff --git a/source/base/logstream.cc b/source/base/logstream.cc index 62d90041df..a41544dbb0 100644 --- a/source/base/logstream.cc +++ b/source/base/logstream.cc @@ -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 {