From 034d58aecaa4ec1c246fb8d4ca88e813e3c9ce63 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Fri, 19 Jul 2024 14:37:10 +1000 Subject: [PATCH] Prevent unit test failures --- src/test/cpp/asyncappendertestcase.cpp | 3 +-- src/test/cpp/net/telnetappendertestcase.cpp | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/cpp/asyncappendertestcase.cpp b/src/test/cpp/asyncappendertestcase.cpp index 0b6cf7949..33b2f3717 100644 --- a/src/test/cpp/asyncappendertestcase.cpp +++ b/src/test/cpp/asyncappendertestcase.cpp @@ -246,14 +246,13 @@ class AsyncAppenderTestCase : public AppenderSkeletonTestCase std::vector threads; for ( int x = 0; x < threadCount; x++ ) { - std::thread thr([root, LEN]() + threads.emplace_back([root, LEN]() { for (size_t i = 0; i < LEN; i++) { LOG4CXX_DEBUG(root, "message" << i); } }); - threads.push_back( std::move(thr) ); } for ( auto& thr : threads ) diff --git a/src/test/cpp/net/telnetappendertestcase.cpp b/src/test/cpp/net/telnetappendertestcase.cpp index b7aebbe57..1268c227a 100644 --- a/src/test/cpp/net/telnetappendertestcase.cpp +++ b/src/test/cpp/net/telnetappendertestcase.cpp @@ -118,6 +118,7 @@ class TelnetAppenderTestCase : public AppenderSkeletonTestCase #endif LOG4CXX_INFO(root, "Hello, World " << i); } + appender->close(); } };