Skip to content
Snippets Groups Projects
Commit 83eaa4f6 authored by Timo Koch's avatar Timo Koch
Browse files

[test][timeloop] Improve terminal debug output

parent 5288a828
No related branches found
No related tags found
1 merge request!3618[TimeLoop] define base tolerance
Pipeline #37032 passed
+3
...@@ -185,10 +185,10 @@ void testTimeLoops(double tStart, ...@@ -185,10 +185,10 @@ void testTimeLoops(double tStart,
// get result and reset buffer // get result and reset buffer
const auto result = cerrBuffer.str(); const auto result = cerrBuffer.str();
std::cerr.rdbuf(cerrOriginal); std::cerr.rdbuf(cerrOriginal);
std::cout << "Setting check point at the current time printed '" << result << "' to std::cerr" << std::endl; std::cout << "Setting check point at the current time. Printed error message: " << result << std::endl;
if (result.empty()) if (result.empty())
DUNE_THROW(Dune::Exception, "Setting a checkpoint at the current time should print a warning to std::cerr"); DUNE_THROW(Dune::Exception, "Setting a checkpoint at the current time should print a warning to the error stream");
if (Dune::FloatCmp::eq(timeLoop.timeStepSize(), 0.0, 1e-10)) if (Dune::FloatCmp::eq(timeLoop.timeStepSize(), 0.0, 1e-10))
DUNE_THROW(Dune::Exception, "Time Loop reduced time step size to 0!"); DUNE_THROW(Dune::Exception, "Time Loop reduced time step size to 0!");
} }
...@@ -205,10 +205,10 @@ void testTimeLoops(double tStart, ...@@ -205,10 +205,10 @@ void testTimeLoops(double tStart,
// get result and reset buffer // get result and reset buffer
const auto result = cerrBuffer.str(); const auto result = cerrBuffer.str();
std::cerr.rdbuf(cerrOriginal); std::cerr.rdbuf(cerrOriginal);
std::cout << "Setting zero time step printed '" << result << "' to std::cerr" << std::endl; std::cout << "Setting zero time step. Printed error message: " << result << std::endl;
if (result.empty()) if (result.empty())
DUNE_THROW(Dune::Exception, "Setting a zero timeStepSize should print a warning to std::cerr"); DUNE_THROW(Dune::Exception, "Setting a zero timeStepSize should print a warning to the error stream");
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment