From f06a5880fde754b44adb93ac685775d1a313e5b3 Mon Sep 17 00:00:00 2001 From: Florian Schmaus <flow@cs.fau.de> Date: Tue, 23 Mar 2021 17:20:21 +0100 Subject: [PATCH] [ReuseFutureTest] Do not reset the future on the last iteration Resetting the Future on the last iteration may cause the assert that the Future was never awaited to trigger (which is in the Future's destructor). --- tests/ReuseFutureTest.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/ReuseFutureTest.cpp b/tests/ReuseFutureTest.cpp index 7bc930c8..50f01ad7 100644 --- a/tests/ReuseFutureTest.cpp +++ b/tests/ReuseFutureTest.cpp @@ -38,8 +38,10 @@ void emperTest() { DIE_MSG_ERRNO("read failed"); } - // reset the BPS used to signal the completion of this future - read_future.reset(); + if (i != ITERATIONS - 1) { + // reset the BPS used to signal the completion of this future + read_future.reset(); + } } }, cps); @@ -53,8 +55,10 @@ void emperTest() { DIE_MSG_ERRNO("write failed"); } - // reset the BPS used to signal the completion of this future - write_future.reset(); + if (i != ITERATIONS - 1) { + // reset the BPS used to signal the completion of this future + write_future.reset(); + } } }, cps); -- GitLab