Skip to content

Commit

Permalink
Re #7215. Minor simplification.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Jun 3, 2013
1 parent 0615c22 commit 27f76c6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Code/Mantid/Framework/DataHandling/test/MonitorLiveDataTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,11 @@ class MonitorLiveDataTest : public CxxTest::TestSuite
//--------------------------------------------------------------------------------------------
/** Executes the given algorithm asynchronously, until you reach the given chunk number.
* @return false if test failed*/
bool runAlgoUntilChunk(IAlgorithm_sptr alg1, size_t stopAtChunk)
bool runAlgoUntilChunk(boost::shared_ptr<MonitorLiveData> alg1, size_t stopAtChunk)
{
MonitorLiveData * monitor = dynamic_cast<MonitorLiveData*>(alg1.get());
TS_ASSERT(monitor);
if (!monitor) return false;

Poco::ActiveResult<bool> res1 = alg1->executeAsync();
Poco::Thread::sleep(50);
while (monitor->m_chunkNumber < stopAtChunk)
while (alg1->m_chunkNumber < stopAtChunk)
Poco::Thread::sleep(10);
return true;
}
Expand All @@ -175,7 +171,7 @@ class MonitorLiveDataTest : public CxxTest::TestSuite
ConfigService::Instance().setString("testdatalistener.m_changeStatusAfter", "4");
ConfigService::Instance().setString("testdatalistener.m_newStatus", "4" /* ILiveListener::EndRun */);

IAlgorithm_sptr alg1 = makeAlgo("fake1", "", "Add", "Restart", "0.15");
boost::shared_ptr<MonitorLiveData> alg1 = makeAlgo("fake1", "", "Add", "Restart", "0.15");
// Run this algorithm until that chunk #
if (!runAlgoUntilChunk(alg1, 7)) return;

Expand All @@ -198,7 +194,7 @@ class MonitorLiveDataTest : public CxxTest::TestSuite
ConfigService::Instance().setString("testdatalistener.m_changeStatusAfter", "4");
ConfigService::Instance().setString("testdatalistener.m_newStatus", "4" /* ILiveListener::EndRun */);

IAlgorithm_sptr alg1 = makeAlgo("fake1", "", "Add", "Rename", "0.15");
boost::shared_ptr<MonitorLiveData> alg1 = makeAlgo("fake1", "", "Add", "Rename", "0.15");
// Run this algorithm until that chunk #
if (!runAlgoUntilChunk(alg1, 7)) return;

Expand Down

0 comments on commit 27f76c6

Please sign in to comment.