Skip to content
Snippets Groups Projects
Commit 53ded3cc authored by Michael Reuter's avatar Michael Reuter
Browse files

Quiet Eclipse complaints. This refs #100.

parent dea31bee
No related branches found
No related tags found
No related merge requests found
......@@ -37,10 +37,10 @@ public:
progress(0.333,"Running");
interruption_point();
Algorithm* alg = dynamic_cast<Algorithm*>( this );
TS_ASSERT( alg )
TS_ASSERT( alg );
TS_ASSERT_EQUALS( p1, "stuff" )
TS_ASSERT_EQUALS( p2, 17 )
TS_ASSERT_EQUALS( p1, "stuff" );
TS_ASSERT_EQUALS( p2, 17 );
setProperty("out",28);
}
......@@ -62,8 +62,8 @@ public:
void progressHandle(const IAlgorithm* alg,double p,const std::string& msg)
{
progress = true;
TS_ASSERT_EQUALS( p, 0.333 )
TS_ASSERT_EQUALS( msg, "Running" )
TS_ASSERT_EQUALS( p, 0.333 );
TS_ASSERT_EQUALS( msg, "Running" );
}
void finishHandle(const IAlgorithm* alg)
{
......@@ -77,64 +77,64 @@ public:
void testCreateProxy()
{
IAlgorithm_sptr alg = AlgorithmManager::Instance().create("ToyAlgorithmProxy");
TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) )
TS_ASSERT_EQUALS( alg->name() , "ToyAlgorithmProxy" )
TS_ASSERT_EQUALS( alg->version() , 1 )
TS_ASSERT_EQUALS( alg->category() , "Cat" )
TS_ASSERT( alg->isInitialized() )
TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) );
TS_ASSERT_EQUALS( alg->name() , "ToyAlgorithmProxy" );
TS_ASSERT_EQUALS( alg->version() , 1 );
TS_ASSERT_EQUALS( alg->category() , "Cat" );
TS_ASSERT( alg->isInitialized() );
alg->setChild(true);
TS_ASSERT( !alg->isChild() )
TS_ASSERT( alg->existsProperty("prop1") )
TS_ASSERT( alg->existsProperty("prop2") )
TS_ASSERT( !alg->isRunning() )
TS_ASSERT( !alg->isRunningAsync() )
TS_ASSERT( !alg->isChild() );
TS_ASSERT( alg->existsProperty("prop1") );
TS_ASSERT( alg->existsProperty("prop2") );
TS_ASSERT( !alg->isRunning() );
TS_ASSERT( !alg->isRunningAsync() );
alg->setProperty("prop1","stuff");
alg->setProperty("prop2",17);
TS_ASSERT_THROWS_NOTHING( alg->execute() )
TS_ASSERT( alg->isExecuted() )
TS_ASSERT_THROWS_NOTHING( alg->execute() );
TS_ASSERT( alg->isExecuted() );
int out = alg->getProperty("out");
TS_ASSERT_EQUALS(out,28)
TS_ASSERT_EQUALS(out,28);
}
void testRunning()
{
IAlgorithm_sptr alg = AlgorithmManager::Instance().create("ToyAlgorithmProxy");
TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) )
TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) );
alg->setProperty("prop1","stuff");
alg->setProperty("prop2",17);
Poco::ActiveResult<bool> res = alg->executeAsync();
res.tryWait(100);
TS_ASSERT( alg->isRunning() )
TS_ASSERT( alg->isRunningAsync() )
TS_ASSERT( alg->isRunning() );
TS_ASSERT( alg->isRunningAsync() );
res.wait();
TS_ASSERT( res.data() )
TS_ASSERT( alg->isExecuted() )
TS_ASSERT( res.data() );
TS_ASSERT( alg->isExecuted() );
}
void testCancel()
{
IAlgorithm_sptr alg = AlgorithmManager::Instance().create("ToyAlgorithmProxy");
TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) )
TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) );
alg->setProperty("prop1","stuff");
alg->setProperty("prop2",17);
Poco::ActiveResult<bool> res = alg->executeAsync();
res.tryWait(100);
alg->cancel();
res.wait();
TS_ASSERT( !alg->isExecuted() )
TS_ASSERT( !alg->isExecuted() );
int out = alg->getProperty("out");
TS_ASSERT_EQUALS(out,8)
TS_ASSERT_EQUALS(out,8);
}
void testAddObserver()
{
IAlgorithm_sptr alg = AlgorithmManager::Instance().create("ToyAlgorithmProxy");
TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) )
TS_ASSERT( dynamic_cast<AlgorithmProxy*>(alg.get()) );
alg->setProperty("prop1","stuff");
alg->setProperty("prop2",17);
TestProxyObserver obs(alg);
Poco::ActiveResult<bool> res = alg->executeAsync();
res.wait();
TS_ASSERT( obs.start )
TS_ASSERT( obs.progress )
TS_ASSERT( obs.finish )
TS_ASSERT( obs.start );
TS_ASSERT( obs.progress );
TS_ASSERT( obs.finish );
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment