From 031dc6c0a3850b5fcde565a46b193321bdb8c491 Mon Sep 17 00:00:00 2001 From: Hongli Lai Date: Tue, 8 Oct 2024 17:51:58 +0200 Subject: [PATCH] Fix timing issue in BufferedIOTest --- test/cxx/IOTools/BufferedIOTest.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/cxx/IOTools/BufferedIOTest.cpp b/test/cxx/IOTools/BufferedIOTest.cpp index 311cfdc411..98cd6b4116 100644 --- a/test/cxx/IOTools/BufferedIOTest.cpp +++ b/test/cxx/IOTools/BufferedIOTest.cpp @@ -328,8 +328,10 @@ namespace tut { TEST_METHOD(30) { // It blocks until a line can be read or until EOF. - TempThread thr1(boost::bind(writeAfterSomeTime, writer, 20000, "hello")); - TempThread thr2(boost::bind(writeAfterSomeTime, writer, 35000, "\nworld\n.")); + TempThread thr([&]() { + writeAfterSomeTime(writer, 20000, "hello"); + writeAfterSomeTime(writer, 15000, "\nworld\n."); + }); Timer<> timer1; ensure_equals(io.readLine(), "hello\n"); ensure_equals(io.getBuffer(), "world\n.");