diff --git a/src/test/jtx/impl/Env.cpp b/src/test/jtx/impl/Env.cpp index f5f213710..b9a0660e0 100644 --- a/src/test/jtx/impl/Env.cpp +++ b/src/test/jtx/impl/Env.cpp @@ -154,6 +154,9 @@ public: Env::AppBundle::AppBundle(beast::unit_test::suite& suite, std::unique_ptr config) { + using namespace beast::severities; + // Use kFatal threshold to reduce noise from STObject. + setDebugLogSink (std::make_unique("Debug", kFatal, suite)); auto logs = std::make_unique(suite); auto timeKeeper_ = std::make_unique(); @@ -163,7 +166,7 @@ Env::AppBundle::AppBundle(beast::unit_test::suite& suite, owned = make_Application(std::move(config), std::move(logs), std::move(timeKeeper_)); app = owned.get(); - app->logs().threshold(beast::severities::kError); + app->logs().threshold(kError); if(! app->setup()) Throw ("Env::AppBundle: setup failed"); timeKeeper->set( @@ -183,6 +186,9 @@ Env::AppBundle::~AppBundle() app->getJobQueue().rendezvous(); app->signalStop(); thread.join(); + + // Remove the debugLogSink before the suite goes out of scope. + setDebugLogSink (nullptr); } //------------------------------------------------------------------------------ diff --git a/src/test/protocol/InnerObjectFormats_test.cpp b/src/test/protocol/InnerObjectFormats_test.cpp index 442e8a512..f17dc80c5 100644 --- a/src/test/protocol/InnerObjectFormats_test.cpp +++ b/src/test/protocol/InnerObjectFormats_test.cpp @@ -24,6 +24,7 @@ #include // Json::Reader #include // STParsedJSONObject #include +#include namespace ripple { @@ -175,6 +176,9 @@ public: { using namespace InnerObjectFormatsUnitTestDetail; + // Instantiate a jtx::Env so debugLog writes are exercised. + test::jtx::Env env (*this); + for (auto const& test : testArray) { Json::Value req; diff --git a/src/test/protocol/STObject_test.cpp b/src/test/protocol/STObject_test.cpp index fa4518fc3..6dd569d96 100644 --- a/src/test/protocol/STObject_test.cpp +++ b/src/test/protocol/STObject_test.cpp @@ -24,6 +24,8 @@ #include #include #include +#include + #include #include @@ -501,6 +503,9 @@ public: void run() { + // Instantiate a jtx::Env so debugLog writes are exercised. + test::jtx::Env env (*this); + testFields(); testSerialization(); testParseJSONArray();