From 8a609938e0a2c07ea66de2cf09188432bc65e3f2 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 26 Feb 2017 15:31:49 +0100 Subject: [PATCH] Allow to customize the values used in test_mode --- include/deal.II/base/logstream.h | 9 ++++++--- source/base/logstream.cc | 11 +++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) 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 { -- 2.39.5