aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/ProfilingTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiling/test/ProfilingTests.cpp')
-rw-r--r--src/profiling/test/ProfilingTests.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp
index d14791c43d..9dd7cd3d64 100644
--- a/src/profiling/test/ProfilingTests.cpp
+++ b/src/profiling/test/ProfilingTests.cpp
@@ -174,7 +174,6 @@ BOOST_AUTO_TEST_CASE(CheckCommandThread)
commandThread0.Start();
commandThread0.Stop();
- commandThread0.Join();
BOOST_CHECK(profilingStateMachine.GetCurrentState() == ProfilingState::Active);
@@ -188,11 +187,15 @@ BOOST_AUTO_TEST_CASE(CheckCommandThread)
testProfilingConnectionTimeOutError);
commandThread1.Start();
- commandThread1.Join();
+
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
+ BOOST_CHECK(!commandThread1.IsRunning());
+ commandThread1.Stop();
BOOST_CHECK(profilingStateMachine.GetCurrentState() == ProfilingState::WaitingForAck);
//now commandThread1 should persist after a timeout
- commandThread1.StopAfterTimeout(false);
+ commandThread1.SetStopAfterTimeout(false);
commandThread1.Start();
for (int i = 0; i < 100; i++)
@@ -208,11 +211,9 @@ BOOST_AUTO_TEST_CASE(CheckCommandThread)
}
commandThread1.Stop();
- commandThread1.Join();
BOOST_CHECK(profilingStateMachine.GetCurrentState() == ProfilingState::Active);
-
CommandThread commandThread2(1,
false,
commandHandlerRegistry,
@@ -226,13 +227,13 @@ BOOST_AUTO_TEST_CASE(CheckCommandThread)
if (!commandThread2.IsRunning())
{
//commandThread2 should stop once it encounters a non timing error
- commandThread2.Join();
return;
}
std::this_thread::sleep_for(std::chrono::milliseconds(5));
}
BOOST_ERROR("commandThread2 has failed to stop");
+ commandThread2.Stop();
}
BOOST_AUTO_TEST_CASE(CheckEncodeVersion)